Hi,

At Wed, 13 Jan 2010 20:42:33 +0900,
Vladimir Sizikov wrote in [ruby-core:27583]:
> ruby -ve "p 'test' << -1"
> ruby 1.9.2dev (2010-01-13) [i686-linux]
> "test\xFF"
> 
> ruby -ve "p 'test' << -2"
> ruby 1.9.2dev (2010-01-13) [i686-linux]
> "test\xFE"
> 
> ruby -ve "p 'test' << -3"
> ruby 1.9.2dev (2010-01-13) [i686-linux]
> -e:1:in `<main>': negative string size (or size too big) (ArgumentError)
> 
> So, what's the proper/desired/correct behavior here?

All of above should raise exceptions, I think.

> P.S. In JRuby, we currently always raise ArgumentError on negative values.

Integer#chr raises RangeError.

-- 
Nobu Nakada