Comment on this RCR (edit wiki page) | RCRchive home

RCR 156: Enumerable#zip(an_enumerable)

submitted by flgr on 2003-10-01 15:46:40


This is a legacy RCR. If this is your RCR, please resubmit it using the new format and process.


I'm not sure whether this is a bug or just a missing feature, but #zip seems to be lacking some symmetry:

("a".."b").zip([1, 2]) # => [["a", 1], ["b", 2]]
[1, 2].zip("a".."b") # TypeError: cannot convert Range into Array

IMHO both should produce the same result which I'd assume to be no exception.


Vote for this RCR

Strongly opposed [0]
Opposed [0]
Neutral [0]
In favor [0]
Strongly advocate [1]

Change the status of this RCR to:

accepted

rejected

withdrawn


Add comments here

Re: Enumerable#zip(an_enumerable) (, 2003-10-02 18:17:25)

huh, Range#to_ary seems to be not-defined, while to_a is... any particular reason why that implicit casting is missing?

Kero.

Back to RCRchive.


RCR Submission page and RCRchive powered by Ruby, Apache, RuWiki (modified), and RubLog