From: "Hal E. Fulton" Date: 2003-03-27T15:48:59+09:00 Subject: Anyone ever confused by Array#slice! method? I just realized a minute ago why every time I use the slice! method, one or two of my neurons misfire. All "bang" methods modify the receiver (though the converse is not true -- let's not start that one up again). And most of them return that modified receiver... but not the slice! method. I see why this is, and I'm not complaining. And of course, now that I know why it confuses me, it never will again. Nice feeling! :) Just for those who are keeping score, here's some Ruby-core trivia: 1. The String#slice! method works the same way as Array#slice!, thank goodness (and Matz). 2. Offhand I don't see *any* other bang methods in the core that behave that way. 3. Some bang methods return nil if the object is not actually changed: gsub!, delete!, others. 4. Now here's a trivia question. What bang method appears in two different core modules and (it could be argued) does not really change its receiver? (OK, in a way it does. Don't quibble with me.) Just some midnight ramblings. Ignore at your leisure. Cheers, Hal