From: Damphyr Date: 2005-12-19T09:54:56+09:00 Subject: Re: Undefined method Jacob Fugal wrote: > On 12/14/05, Tom Reilly wrote: > >>You could also define [] for the nil class and have it return whatever >>you thought appropriate. For example: >> >>class NilClass >> def [] >> nil #or whatever you want returned >> end >>end > > > No, no, NO! See, this situation is exactly why I *wouldn't* want > Ruby's nil to follow the NilObject pattern (or whatever it's called). > If it did, Mark would be getting wrong results as opposed to the > undefined method exception. Which do you think is easier to debug? > I'll take the exception that tells me what line number, any day. > I'll second that and quote Dave and Andy: "Crash Early" V.- -- http://www.braveworld.net/riva ____________________________________________________________________ http://www.freemail.gr - ������ �������� ������������ ������������. http://www.freemail.gr - free email service for the Greek-speaking.