Robert Dober wrote:
> hi here I am again;)
> 
> my original (simplified question was): Why Nil#to_i and not Nil#split.
> Generally why X#a and not X#b?
> 
> Well that's pretty much all, actually there are quite some ways to
> look at this, but I shall learn and not teach, so I will just be
> silent for once;)
> 
> All comments are appreciated.
> 
> Robert

I'd like Nil only to respond to the same methods as Object does.
That said, I'd not have anything against a special syntax to say "go on 
unless the value is nil"
E.g.
# this will raise if gets returns nil
while line = gets.chomp

# just returns nil
while line = gets->chomp

I.e. while . would work normally, -> would stop the method chain as soon 
as the receiver is nil and just return nil.
Unlike a Nil responding to everything and just returning nil again, this 
one would leave the coder in control as to specify where he actually 
wants to know immediatly if he has a nil and where he doesn't want to 
know because the result is the same.
I don't know how difficult that would be to implement, though.

Regards
Stefan

-- 
Posted via http://www.ruby-forum.com/.