Perl 6 Cool operators in Perl 6 #7

Hyperoperators (vector processing)

We can also "promote" scalar values to act like arrays:

##  multiply all elements by 3.5
@b = @a »*» 3.5;

##  multiply all elements of @x by $m and add $b
@y = @x »*» $m »+» $b;

The orientation of the arrows indicate where extension is to occur.

##  inverse of @x
@inv = 1 «/« @x;
Copyright © 2009
http://www.pmichaud.com/2009/pres/