From: Ross Bamford Date: 2006-01-04T02:12:58+09:00 Subject: Re: Implicit block parameter? On Tue, 03 Jan 2006 13:52:03 -0000, Devin Mullins wrote: > dblack@wobblini.net wrote: (David, can't see your message in the newsgroup, so I'll reply with this one) > >> Hi -- >> On Tue, 3 Jan 2006, Ross Bamford wrote: >> >>> Wicked :) I can confirm that seems to work in 1.8 (though I had to >>> make one change manually because the source is slightly different of >>> course). I guessed it'd be something that would be reasonably easy >>> (when you know how ;)) from the C side. >>> >>> FWIW +1 for inclusion in a future Ruby. >> >> You can submit it as an RCR if you wish, at http://www.rcrchive.net. >> (I'll vote "Strongly opposed", but don't let that stop you :-) > Hmm, I might put together a bit of a proposal and do that. I hope you'll comment when you vote no, I'd be interested in your perspective on this :) (Replying to Devin's message) > For what it's worth, I'll probably only vote "neutral" for the lack of > readability it encourages (not naming the things). It's not as if people > name their variables "it" a lot... :) Yeah, readability is a downside but I think with a name like 'it' it would mostly be pretty self evident, and of course it shouldn't preclude doing it the current way (declaring the argument). That was the reason I didn't mention another idea, about making $_ the implicit block arg so you could do: ['one','two','three'].select { ~/t[a-z]*/ } (I don't actually advocate that but it occured while I was playing with the 'it' thing). -- Ross Bamford - rosco@roscopeco.remove.co.uk