From: matz@... (Yukihiro Matsumoto) Date: 2001-07-13T08:32:26+09:00 Subject: [ruby-talk:17764] Re: Array#sort! returns nil when array empty Hi, In message "[ruby-talk:17733] Re: Array#sort! returns nil when array empty" on 01/07/13, hal9000@hypermetrics.com writes: | |> pigeon% ruby -ve 'p [].sort!' |> ruby 1.7.1 (2001-07-03) [i686-linux] |> [] |What about other "bang" methods? Are they |still the same? reverse! always returns self too. Current behavior of "bang" methods is: (a) to provide the cheapest way to detect modification. (b) to discourage method chaining of "bang" methods, to avoid unnecessary surprises caused by object aliasing. Because it's hard to detect modification for "sort!" and "reverse" methods, they now return self always. And don't forget to avoid "bang" method chaining. In next major release, I plan to make non-bang methods as fast as bang methods in most of the cases (for non aliased objects), by using partial reference counting. matz.