By the way: if you override an operator, you can still access the original one
using CORE::
sub infix:<+>($,$) { 42 }
say 200 + 300; # 42
say infix:<+>(200,300); # 42
say &CORE::infix:<+>(200,300); # 500
> On 26 Nov 2021, at 20:30, rir wrote:
>
> Wow,
You mean like:
say &infix:<+>(has 42,137); # 179
?? If so, by referring to its full name :-)
> On 26 Nov 2021, at 15:07, rir wrote:
>
> Is it possible to to delegate plain or overridden operators? If so,
> what does the syntax look like?
>
> Rob
Is it possible to to delegate plain or overridden operators? If so,
what does the syntax look like?
Rob
Hi,
According to synopsis 12 I could defer methods to methods in another object.
The case in which one can map some name into another didn't work out.
*
**
**class A {**
** method say-i (Int $i ) { say "I: $i"; }**
**}**
**
**class B {**
** has A $.n handles { :x };**
**
** submethod BUILD { $