From: Bill Kelly Date: 2005-02-22T00:27:59+09:00 Subject: Re: destructive! operations 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. 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. Regards, Bill