From: "C?dric Foll" <cedric.foll-nospam / bigfoot.com>

> Hi,
>
> why the '+' method of nil isn't defined ?
>
> For exemple:
>     nil + "aaa" should return "aaa"
>     nil + 3 should return 3
>     nil + [1,2] should return [1,2] ....
> Perl works like that (at least for the first two exemple).
> It is convenient to do something like
> while gets do
>  res += $_
> end
>
> without having to do res = "" before.
>
> Regards.
>
> --
> Cedric Foll
> courriel: cedric dot foll at laposte dot net

Some people will give you good reasons why it's not like that in Ruby.  You
should try implementing it yourself and see if it causes you any problems down
the track.

  class NilClass
    def +(other)
      other
    end
  end

Cheers,
Gavin