Project

General

Profile

Actions

Bug #4282

closed

Range#map inconsistency with blocks like {...} and do...end

Added by dre3k (Andrei Kulakov) over 13 years ago. Updated almost 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]
Backport:
[ruby-core:34504]

Description

=begin
I'm not sure that it's supposed to be like that:

p (1..2).map{|i|
i
}.class # => Array

p (1..2).map do |i|
i
end.class # => #<Enumerator: 1..2:map>

p (1..2).map do |i|
i
end.to_a.class # => #<Enumerator: 1..2:map>
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0