From: Ross Bamford Date: 2006-01-03T06:42:57+09:00 Subject: Re: Implicit block parameter? On Mon, 02 Jan 2006 20:20:30 -0000, I wrote: > Before I used Ruby, I used Groovy. In some ways they are (well, were > anyway) quite similar, and one feature that I found cool in Groovy that > I often miss in Ruby is the implicit (/default/whatever?) block > parameter, 'it': > > [1,2,3].each { puts it } > > [...] > > I did try hacking it from the Ruby side and came up with a halfway > solution using instance variables and the Binding extension from > Rubyforge: > I got a bit closer by defining an attr_reader 'it' on Kernel, but still it doesn't work with all Procs or via Yield... -- Ross Bamford - rosco@roscopeco.remove.co.uk