Christoffer Sawicki wrote:
> Dear Rubyists,
> 
> def x() yield rescue :error end
> 
> [ x { Integer(nil) }, x { Float(nil) }, x{ String(nil) } ]
> # => [0, :error, ""]
> 
> Isn't that a bit inconsistent?

Is this better?

irb(main):003:0> nil.to_i
=> 0
irb(main):004:0> nil.to_f
=> 0.0
irb(main):005:0> nil.to_s
=> ""

Cheers

	robert