From: nobu.nokada@... Date: 2004-04-25T14:23:51+09:00 Subject: Re: RCR: Accumulating block Hi, At Sun, 25 Apr 2004 03:04:04 +0900, Martin DeMello wrote in [ruby-talk:98258]: > A bit of a wild idea, but how about syntactic support for accumulating > the results of multiple calls to yield? > > a = [] > (1..10).step(2) {|i| > ... > a << retval > } > > could become > > a = (1..10).step(2) [|i| ...] I don't feel it so essential. $ ruby -renumerator -e 'p (1..10).enum_for(:step, 2).to_a [1, 3, 5, 7, 9] -- Nobu Nakada