From: Christopher Dicely Date: 2011-07-24T15:24:14+09:00 Subject: Re: Better name for #zip_with On Mon, Jul 18, 2011 at 10:25 AM, Robert Klemme wrote: > Thomas Sawyer wrote in post #1011313: >> On Jul 17, 10:36pm, John Feminella wrote: >>> How about #zip_and_map? Notice that: >>> >>> > a.zip_with(b) { |c, d| ... } >>> >>> is the same as the result of >>> >>> > a.zip(b).map { |c, d| ... } >> >> Ah, right. `#zip_map` would makes sense then. But per your last post, >> I think I may override #zip itself. > > Not sure whether I find this a good idea.  Reason: #map has overhead of > creating a new Array with the same length as the input.  That should not > be the default behavior IMHO. So, don't do that; just return an Enumerator that returns the successive results of applying the given block to the elements that would be returned by the Enumerator that would be returned by the non-block form of #zip.