From: Pit Capitain Date: 2005-02-22T01:31:18+09:00 Subject: Re: destructive! operations Christian Neukirchen schrieb: >>>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 Here you go: EATING_NIL = Object.new def EATING_NIL.nil? true end def EATING_NIL.method_missing(*) self end class Object def ignore_if_nil self end end def nil.ignore_if_nil EATING_NIL end Regards, Pit