From: Michael Fellinger Date: 2009-12-11T01:02:09+09:00 Subject: [ruby-core:27131] Re: #to_enum ignores block? On Thu, Dec 10, 2009 at 11:58 PM, Roger Pack wrote: >> The whole purpose of to_enum is to return an Enumerator instance. >> The block has no meaning and is ignored, it's what the docs and source say. >> What did you expect it to do? > > I would expect it to act like a filter. >>> (1..3).to_enum {|n| n*2}.to_a > => [1, 4, 9] > > Apparently it used to do that--anybody know if it was a conscious > decision to take it out? > > Perhaps you could toss me a link to the docs that describe how it > treats blocks, as well? http://ruby-doc.org/ruby-1.9/classes/Object.src/M000206.html As I said, it doesn't treat blocks. -- Michael Fellinger