From: Holden Holden Date: 2008-01-04T09:18:03+09:00 Subject: Re: Troubles with blocks Gary Wright wrote: > In Ruby 1.8: > > require 'enumerator' > %w{a b c}.enum_for(:each_with_index).to_a > > In Ruby 1.9: > > %w{a b c}.each_with_index.to_a > Thanks! that's exactly what I was looking for. I had already tried the last solution but I got a "no block given" error (I'm using Ruby 1.8). I'm glad to hear that versions 1.9 and higher support this construct. -- Posted via http://www.ruby-forum.com/.