Perl6 Wiki

Hyper operator

77pages on
this wiki

A hyperoperator is a basic binary operator surrounded by << and/or >>

It allows you to "spread" an operator between 2 lists. Those lists can have different lengths (even with 1 element only) and you can specify the "spreading" behavior using the << and/or >> at both sides of the hyper operator

Examples Edit

Add 1 to every element of an array Edit

my @result = 1 <<+<< (2,3,4); 
@result.perl.say; # Show the data structure

Around Wikia's network

Random Wiki