From: Austin Ziegler Date: 2005-05-07T02:28:18+09:00 Subject: Re: RCR 303: nil should accept missing methods and return nil On 5/5/05, John Carter wrote: >> This would be a big change to behaviour and a lot of existing >> programs could have problems with it. Because integers already >> have a to_i(), its possible to do this... > > If there were a lot of programs deliberately doing > > begin > # some complex calculation > rescue NoMethodError => details > # Do some valid functionality, not just error handling > end > > I would agree with out. > 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. Um. I think that the point being made is that crashing, in this case, *is* doing the right thing. If nil respondedd to all methods silently, how would you ever know when your method got the *wrong* data? I said this on the RCR comment area, but PDF::Writer is *correct* to blow up when it gets nil. Without this, there are things that I could not *possibly* have debugged. With the silent eating of messages, the generated PDF files would be incorrect -- invalid -- and there's not a damned thing I could do to tell where the problem is. I don't really know what to say to this -- this will turn a correct behaviour into a completely invalid behaviour. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca