From: Eustaquio 'TaQ' Rangel Date: 2008-06-04T04:49:55+09:00 Subject: About 1.8.7 Array#map! without a block Hi there. I was wondering how to use Array#map! with a block. On the usual way, we have irb(main):001:0> a = [1,2,3] => [1, 2, 3] irb(main):002:0> a.map! {|i| i*2} => [2, 4, 6] Now with 1.8.7 we have: irb(main):003:0> e = a.map! => # irb(main):004:0> e.next => 2 irb(main):005:0> a => [#, @index=1, @block=#, @cont_yield=#, @cont_next=nil>, 4, 6] irb(main):006:0> a.size => 3 I got an Enumerable::Enumerator with a.map! and then the first call to e.next returned me the first "a" element, 2. Ok, two questions: 1 - Since I created the Enumerable::Enumerator with map!, I presume it's used on some way to change the elements on "a", so what should I use with e.next to change the value, say, multiplying by 2 as on the first case and have a [4,8,12] array on the end? 2 - Why I get a Generator on "a" elements when I just call e.next? The cause it's what I'm missing to use with next, as asked on the first question? Thanks!