Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enumerable#map and #collect with #lazy and docs #77

Open
pudiva opened this issue Mar 9, 2017 · 0 comments
Open

Enumerable#map and #collect with #lazy and docs #77

pudiva opened this issue Mar 9, 2017 · 0 comments

Comments

@pudiva
Copy link

pudiva commented Mar 9, 2017

This says that #map returns an_enumerator and a new array:

http://ruby-doc.org/core-2.4.0/Enumerable.html#method-i-map

irb says:

irb(main):002:0> [1,2,3].map {|x| x+1}.class
=> Array
irb(main):003:0> [1,2,3].lazy.map {|x| x+1}.class
=> Enumerator::Lazy

and Lazy docs says nothing about behaving differently.

and i can be hallucinating, but i remember seeing different things about #map and #collect on this page, saying that #map would return enumerator and #collect would return array.

<3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant