String#slice! changed behavior


(Yukihiro Matsumoto) #1

Hi,

···

In message “String#slice! changed behavior” on 02/06/01, Marcin ‘Qrczak’ Kowalczyk qrczak@knm.org.pl writes:

For “abcd”.slice!(/x/) ruby-1.6.7 does nothing and ruby from cvs
raises IndexError. Was this change intentional?

Yes. To make errors to be detected early.

“abcd”.slice(10) raises IndexError, so should “abcd”.slice!(/x/), I
thought.

						matz.