develooper Front page | perl.perl6.language | Postings from August 2006

Re: Pair of lists => list of pairs?

Thread Previous | Thread Next
From:
Michael Snoyman
Date:
August 23, 2006 15:16
Subject:
Re: Pair of lists => list of pairs?
Message ID:
dc69626e0608231516o3a4f95b9pec1eac06ddedf04e@mail.gmail.com
>
> : my %h;
> : %h{@k} = @v;
> :
> : But is there an easy way in Perl6 to do it all in one go?  Should this
> work?
> :
> : my %h = @k [=>] @v;
>
> Reduce operators only turn infix into list operators.  What you really
> want here is a hyper-fatarrow:
>
>     my %h = @k »=>« @v;


Gaal pointed out using zip.  What would be the difference then between a
hyper-fatarrow and zip in this case?


Michael

Thread Previous | 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