First-class functions
my \𝐴 = &sin, &cos, { $_ ** <3/1> }
my \𝐵 = &asin, &acos, { $_ ** <1/3> }
say .(.5) for 𝐴 Z∘ 𝐵Output:
0.5
0.4999999999999999
0.5000000000000001my @a = 1,2,3;
my @op = &infix:<+>, &infix:<->, &infix:<*>;
for flat @a Z @op -> $v, &op { say 42.&op($v) }Output:
43
40
126Last updated