I
Intransition
First a big shout-out to Marc-Andre Lafortune and his <a href="http://
github.com/marcandre/backports">backports</a> project. Nice work.
Now I want to ask if others have noticed all the new methods being add
to 1.9+? I'm quite happy about vast majority of it, but there was at
least one method I thought pretty peculiar. This Enumerable method:
def flat_map(&block)
return to_enum
flat_map) unless block_given?
map(&block).flatten(1)
end unless method_defined? :flat_map
Backports.alias_method self, :collect_concat, :flat_map
I am very curious to know how it was decided that a normal map
followed by a 1-deep flatten is common enough to warrant its own
method? Two in fact!
github.com/marcandre/backports">backports</a> project. Nice work.
Now I want to ask if others have noticed all the new methods being add
to 1.9+? I'm quite happy about vast majority of it, but there was at
least one method I thought pretty peculiar. This Enumerable method:
def flat_map(&block)
return to_enum
map(&block).flatten(1)
end unless method_defined? :flat_map
Backports.alias_method self, :collect_concat, :flat_map
I am very curious to know how it was decided that a normal map
followed by a 1-deep flatten is common enough to warrant its own
method? Two in fact!