Editing Topic: RCR156 Project: RCR | 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.



Back to RCRchive.


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