In message <[EMAIL PROTECTED]> Graham Barr <[EMAIL PROTECTED]> wrote: > On Fri, Aug 11, 2000 at 03:30:28PM -0000, Perl6 RFC Librarian wrote: > > > In order to reverse this operation we need an C<unzip> function: > > > > @zipped_list = zip(\@a,\@b); # (1,2,3,4,5,6) > > @unzipped_list = unzip(3, \@zipped_list); # ([1,3,5], [2,4,6]) > > Is unzip used that often ? I wondered the same thing. As far as I can tell from a quick perusal of my copy of "Introduction to Functional Programming" there isn't a direct inverse of zip in Miranda. Of course if the array slicing RFC goes through you could always extract the original lists from a zipped list using array slices. > > =head1 IMPLEMENTATION > > > > The C<zip> and C<unzip> functions should be evaluated lazily. > > lazily ? why, no other operator does by default (I am asuming here) Currently... I thought one idea for perl6 was to make more things use iterators instead of creating large temporary lists. Tom -- Tom Hughes ([EMAIL PROTECTED]) http://www.compton.nu/ ...I'm so close to hell I can almost see Vegas!
- Re: RFC 90 (v1) Builtins: zip() and unzip() Damien Neil
- Re: RFC 90 (v1) Builtins: zip() and unz... Dave Storrs
- Re: RFC 90 (v1) Builtins: zip() an... Ariel Scolnicov
- Re: RFC 90 (v1) Builtins: zip() and unzip() Brad Hughes
- Re: RFC 90 (v1) Builtins: zip() and unzip() Mike Pastore
- Re: RFC 90 (v1) Builtins: zip() and unzip() Damian Conway
- Re: RFC 90 (v1) Builtins: zip() and unzip() John Porter
- Re: RFC 90 (v1) Builtins: zip() and unz... Dan Sugalski
- Re: RFC 90 (v1) Builtins: zip() and unzip() Damian Conway
- Re: RFC 90 (v1) Builtins: zip() and unz... Michael Fowler
- Re: RFC 90 (v1) Builtins: zip() and unzip() Tom Hughes
- Re: RFC 90 (v1) Builtins: zip() and unzip() Philip Newton
- Re: RFC 90 (v1) Builtins: zip() and unzip() Jeremy Howard
- Re: RFC 90 (v1) Builtins: zip() and unzip() John Porter
- Re: RFC 90 (v1) Builtins: zip() and unzip() raptor
- Re: RFC 90 (v1) Builtins: zip() and unzip() raptor
- Re: RFC 90 (v1) Builtins: zip() and unzip() Stephen P. Potter
- Re: RFC 90 (v1) Builtins: zip() and unzip() Jeremy Howard
- Re: RFC 90 (v1) Builtins: zip() and unzip() Stephen P. Potter
- RE: RFC 90 (v1) Builtins: zip() and unzip() Myers, Dirk
- Re: RFC 90 (v1) Builtins: zip() and unzip() Jarkko Hietaniemi