From: John Carter Date: 2005-05-06T13:44:01+09:00 Subject: Re: RCR 303: nil should accept missing methods and return nil On Fri, 6 May 2005, Aredridel wrote: > >> If they are not doing that, then the program would >> just crash totally. My change would change the behaviour from crashing, to >> Doing The Right thing. > > Only if the right thing is "do not crash ever". > > For me, if a bug like that is exposed, _it's a severe error_. Not > something to say is nil. Is it? Prove me wrong empirically... Save this code as nillit.rb class NilClass def method_missing( symbol, *args) nil end end Next time your program crashes on a "undefined method `foo' for nil:NilClass (NoMethodError)" Rerun your code with.... ruby -rnillit myprog and see what happens, tell me the result. I'm prepared to be proven wrong. John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand Amongst the millions of species are many hundreds of thousands of types beetle and a mere handful of primates. Surprisingly enough, this email does not originate from a beetle.