From: "Brian Schröder" Date: 2005-02-22T01:12:40+09:00 Subject: Re: destructive! operations On Tue, 22 Feb 2005 00:48:42 +0900, Christian Neukirchen wrote: > Brian Schr�der writes: > > > On Tue, 22 Feb 2005 00:14:41 +0900, Christian Neukirchen > >> Then, stuff like that would be possible > >> > >> while line = gets.ignore_if_nil.chomp > >> ... > >> end > >> > >> Maybe just a crazy idea... :-) > > > > What would the ignore_if_nil call in your example do? Wouldn't the > > above be equivalent to > > > > while line = gets.chomp > > ... > > end > > gets returns nil on EOF. > Yes, and you wanted a nil that eats its messages silently. So it would also eat chomp. I meant, if you have a all eating nil then nil.ignore_if_nil.chomp === nil.chomp. Regards, Brian