[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Enumerable#zip(aRange)  does not work ?
From:       gabriele renzi <surrender_it () rc1 ! vip ! ukl ! yahoo ! com>
Date:       2004-02-26 21:34:48
Message-ID: d3ps30dupt11soqgl9rkln9tv6oscl79ae () 4ax ! com
[Download RAW message or body]


Hi gurus and nubys,
I just noticed that enumerable#zip just accepts an Array as argument:


>> puts (1..10).zip(21..30)
TypeError: cannot convert Range into Array

I wonder why this happens: would'nt make much more sense if it just
applied to_ary to it's argument?

note that ri 1.8a (I know, utdated) agrees with me:

(Enumerable#zip)
    Converts any arguments to arrays, then merges elements of enumObj
    with corresponding elements from each argument. 

:)





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic