From: Gavin Sinclair Date: 2005-10-09T20:56:51+09:00 Subject: Re: bang methods Hal Fulton wrote: > > It's not a matter of the English language as such -- English is just > the language that the keywords and method names are based on. > > I oppose select! not on the basis on English purity, but on that of > Ruby purity. Can you justify that opposition in the context of the following Array methods? collect! compact! flatten! map! reject! reverse! slice! sort! uniq! I've read the whole thread (perhaps too quickly), and don't see what at all is controversial about #select! as an in-place #select. I'm neither advocating it nor opposing it on its merits, but I think it's equally meritorious as all of the above. Or even more: #map!/#collect! and #uniq! are quite unappealing to me. Point is: I doubt anyone on this thread would complain (even privately) about #select! if it had been there all along. That's not to belittle the discussion now, but it's a useful perspective. And amongst all the praising of Ruby's balance over symmetry etc., I can't help thinking that if the core classes were redesigned from scratch, they'd be a little cleaner than they are now. [1] That is inevitable and not a criticism. Such a criticism would be niggardly in respect of the overall beauty of the language. Finally, FWIW, here's a list of Array methods that _don't_ have an in-place counterpart (including Enumerable methods): find_all grep sort_by Gee, not many! (Especially as #find_all is just #select.) As a lover of minutae, I'd like to hear people's arguments for and against banging these :) (ooh errrr) Cheers, Gavin P.S. That faint buzz in the back of my mind has become clearer: extensions.rubyforge.org defines Array#select! I put it there at someone's request ages ago.