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

Re: Pair of lists => list of pairs?

Thread Previous | Thread Next
From:
Mark J. Reed
Date:
August 23, 2006 15:24
Subject:
Re: Pair of lists => list of pairs?
Message ID:
f60fe000608231524m2f475b6dg7d3e6968a38f5d7f@mail.gmail.com
>
> > Reduce operators only turn infix into list operators.  What you really
> > want here is a hyper-fatarrow:
> >
> >     my %h = @k »=>« @v;



Ah, right.  Silly  me.  I got hyper and reduce confused.  Thanks!


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


Effectively none. But I think the hyper-notation is clearer here.  Both ¥
and => make pairs, but at least to me, => conveys more explicitly that it's
not just any old pair but specifically a key/value pair.  (Even though =>
also creates Pairs of the "any old" kind.)


-- 
Mark J. Reed <markjreed@mail.com>

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