Hi,
I think it was discussed before but I do not remember a conclusion.
Currently
nil.to_s => ""
nil.to_i => 0
so on.
While in some scenario, this behavior comes handy, in many occasions, it
would result
in mysterious, unnoticed problem. for example
“#{[].shift}” => “”
I’d argue that nil is an object representing a non-existence or
invalidity(false state).
So any message sent to it trying to get back concrete object (such as
to_s/to_i) should result in an exception.
Any comments?
Thanks
-Ted