Issue #5044 has been updated by akr (Akira Tanaka).


Currently it can be implemented as follows.

  % ruby -e 'p [1,2,3].zip([1,2,3]).map {|a,b| a + b }'
  [2, 4, 6]
  % ruby -e 'p [1,2,3].lazy.zip([1,2,3]).map {|a,b| a + b }.to_a'
  [2, 4, 6]

----------------------------------------
Feature #5044: #zip with block return mapped results
https://bugs.ruby-lang.org/issues/5044#change-25152

Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 


Is there any reason that #zip doesn't return results like map?

  [1,2,3].zip([1,2,3]){ |a,b| a + b }  #=> [2,4,6]

Currently, it just returns nil, which seems rather contrary to the return result of the non-block form.



-- 
http://bugs.ruby-lang.org/