From: Hal Fulton Date: 2006-10-08T13:34:23+09:00 Subject: Re: nil being empty Matthew Harris wrote: > I'd like to use the common Python term, "sequence", and ask if a nil > object (None, NULL, whatever some of you call it) is a sequence. What > does nil contain? Nothing, because that's what nil is. It's nothing. > nil is not empty, nor is it full, it's just, #nil? > 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. The frequency of this idiom has naturally led people to want to abstract it a little. Some say: if x.nil_or_empty? and some have said: if x.null? or the equivalent. I do agree that making nil return true for #empty? is the wrong solution. Hal