From: bertrandmuscle@... Date: 2005-03-28T05:09:48+09:00 Subject: Re: ! haphazard Thank you for the information. It doesn't seem that you can chain them either, which is too bad. I'm just surprised by this-- that's a pretty glaring inconsistency. It should be in everything or nothing. Daniel Amelang wrote: > Gotcha. Well, I can tell you firsthand about the controversies of the > 'bang' methods (like 'sort!', etc). Since they really aren't a > necessity (you can get along with just the non-bang versions) and ruby > has only relatively recently acquired sort_by, I bet they just didn't > get around to writing the bang version of sort_by. > > FYI, bang methods have been found to be only slightly more efficient > than their non-bang versions ('sort' and 'sort!' being pretty much the > same, efficiency-wise) In case it helps, we discussed bang methods > quite extensively last week: > > http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/134200 > http://ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/134262 > > I've recently fallen back to only using the non-bang version of > methods and the only thing I've missed is the expressiveness of my > code (e.g. c'mon you 'reject!', 'squeeze!' the 'next!' 'sub!', you > 'succ!'er) > > It's late. > > Dan > >