From: David Chelimsky Date: 2006-10-06T23:27:59+09:00 Subject: Re: nil being empty On 10/6/06, Robert Dober wrote: > On 10/6/06, dblack@wobblini.net wrote: > > > > On Fri, 6 Oct 2006, Ohad Lutzky wrote: > > > > > Show of hands - who thinks this is bad form? > > > > > > class NilClass > > > def empty?; true; end > > > end > > > > /me raises hand. > > > I feel this being an unnecessary generalization. > Probably it is very often not the best way to treat the problem, but > it might as easily be the most elegant. > Instead of raising your hand David, please speak out ;) > Now it would be unfair to ask others for their wisdom without delivering my > own (as small as it might be). > > If you define your small little NilClass monkeypatch above because you had > nils where you expected containers, guess what I think of your code ;) Sometimes the code your code plays with is not your code.