The R metaop should reverse the effect of the operator it applies too. However, it does apparently a bit more than that, reversing lists if that's what it's applied to:
my @crossed = <1 2 3> Z <4 5 6>; # [(1 4) (2 5) (3 6)]
say [RZ] @crossed; # ((3 2 1) (6 5 4))
What I would like to obtain is the original lists, however, the result is reversed. Is there something I'm missing here?
R metaop does not reverse the effect of the operator. Instead it reverses the order of the operands, i.e.
$lhs <op> $rhs === $rhs R<op> $lhs
Or in your example the semantics are like this:
[RZ] [<1 4>, <2 5>, <3 6>] #is the same as [Z] [<3 6>, <2 5>, <1 4>]
Z itself does already create the original lists. No need for R Operator.
my @crossed = <1 2 3> Z <4 5 6>; # [(1 4) (2 5) (3 6)]
say [Z] @crossed; #((1 2 3) (4 5 6))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With