Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Joining Arrays? (perl6)

by TimToady (Parson)
on Dec 23, 2008 at 02:25 UTC ( #732226=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Joining Arrays? (perl6)
in thread Joining Arrays?

Such cross-like operations are common enough that there is also a cross meta-operator in Perl 6 to trick an ordinary binary operator into doing it. So instead of saying:

my @combined = (@urls X @ids).map: {$^a ~ $^b};
you can just say
my @combined = @urls X~ @ids;
That is, just put X in front of the ordinary operator to make it a cross operator.

Update: changed old X~X form to new X~ form.


Comment on Re^3: Joining Arrays? (perl6)
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://732226]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2015-07-29 03:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls