From: Christian Neukirchen Date: 2005-02-22T00:48:16+09:00 Subject: Re: destructive! operations "Bill Kelly" writes: > From: "Christian Neukirchen" >> >> Sometimes, I'd like an "eating nil" that returns itself for each >> method call, and is false. >> >> Then, stuff like that would be possible >> >> while line = gets.ignore_if_nil.chomp >> ... >> end >> >> Maybe just a crazy idea... :-) > > class NilClass > def method_missing(meth_id, *args); self; end > end > > ? > > :) > > ObjectiveC's nil works this way. I know that. > The downside is you don't find out as early when you > received an unexpected nil, in situations where you > would have preferred to be notified. I know that too, and that's why I want an explict conversion. > Bill -- Christian Neukirchen http://chneukirchen.org