From: "Christian Neukirchen" <chneukirchen / gmail.com>
>
> 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