Say I want to apply an array of functions to an array of objects. Something like this:
my $a = sub ($) { $_ * 2 };
my $b = sub ($) { $_ / 2 };
my @funcs = ($a, $b);
my @ops = @funcs.roll(4);
I could do
say ^10 ».&» @ops;
but .&
is a postfix operator; same thing for >>., which could be used for a single function, however. Using
say ^10 Z. @ops;
with .
actually being the infix operator for calling a method, yields an error about mistaking it for the concatenation operator. I don't think I have any other option left. Any idea?