From: Devin Mullins Date: 2006-10-08T22:36:57+09:00 Subject: Re: nil being empty Hal Fulton wrote: > I think/hope we all know that. The point is that there are times > when it feels natural to say: if x.empty? > > But circumstances force us to say: if x.nil? || x.empty? > or the equivalent. Io has a neat idiom for things like this. Whereas a normal message pass is: size := list size If you do: size := list ?size That's equivalent to: size := if(list, list size, nil) // that is, if/then/else What's nice is you can chain it: size := animal ?limbs ?size But in this situation, you could create a List isNotEmpty method and: x ?isNotEmpty ifFalse(...) Or something. Devin