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

Re: Pair of lists => list of pairs?

Thread Previous | Thread Next
Mark J. Reed
August 23, 2006 15:24
Re: Pair of lists => list of pairs?
Message ID:
> > 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 <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About