David A. Black wrote: > Hi -- > > On Tue, 22 Feb 2005, Gavin Kistner wrote: > >> On Feb 22, 2005, at 6:47 AM, Gavin Kistner wrote: >> >>> I would support an RCR with this proposal, under just about any >>> method name :) >> >> >> As I responded in the destructive! thread, if people are opposed to >> the term "empty?", then what about the sort of fun name of "vapid?" >> instead? > > > It's arguably exactly the opposite of what you'd want -- namely, to > point up the singularity of 0/""/etc., not their ordinariness. 37534 > is more vapid than 0 :-) > > I'm not sold on this anyway. I think it would have the flavor of > "added on to the language as an afterthought". .zero? means the > object is zero, and .empty? means a container object is empty. I > don't think cross-breeding them retains the logic. 100% agree. I especially cannot understand (at least mathematically) why 0 would be empty and 1 not. Why not simply define a has_value? method: def has_value?(obj) case obj when Enumerable !obj.empty? when NilClass, FalseClass false when TrueClass true when Integer !obj.zero? else # do what you want obj.respond_to?(...) ... end end This probably serves most needs... Regards, Michael