Sun, 2 Jun 2002 07:40:43 +0900, Yukihiro Matsumoto matz@ruby-lang.org pisze:
“abcd”.slice(10) raises IndexError, so should “abcd”.slice!(/x/),
I thought.
So what about “abcd”.slice!(‘x’), “abcd”[‘x’] = ‘y’, “abcd”[/x/] = ‘y’
and finally “abcd”.sub!(/x/, ‘y’)? They all don’t raise exceptions.
I don’t say that they all should but that it’s somewhat inconsistent.
···
–
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
__/
^^
QRCZAK