Although as a bit of an anomaly it works with arrays.

's'+[1]

"Dave Thomas" <Dave / PragmaticProgrammer.com> wrote in message
> Why does puts(1) work, but puts('s'+1) not work?  It gives:
> >
> > The error message makes it clear that it knows it should be converted to
a
> > string.  Why didn't + method just do a .to_s to the parameter coming in?
>
> #puts knows that it it's parameter is not a string, it can call
> to_s. However, in general, matz decided that allowing arithmetic on
> arbitrary strings leads to too many errors, so he did not add
> string coercion to the standard arithmetic operators. You can always
> add it if you'd like (putting it into a file you could require would
> make it reusable across all your programs).
>