develooper Front page | perl.perl6.language | Postings from March 2005

&zip

Thread Next
From:
Rod Adams
Date:
March 15, 2005 00:47
Subject:
&zip
Message ID:
4236A125.7010200@rodadams.net
I'm trying to define zip(), but can't come up with a signature for a 
function that returns a lazy list of lvalues, but the list itself is not 
lazy?

As a second matter, can you declare a type for the elements of a slurpy 
array?

So far I have:

 multi sub zip (Array *@lists) returns List {
   gather {
     while any(@lists) {
       for @lists -> @list {
         take shift @list;
       }
     }
   }
 }

But I can't tackle the lvalue problem.

btw, I'm defining the semantics of some of several functions by simply 
supplying a reference implementation.




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About