I tried to make a new "growth" operator.
The code was

(32 + 48).say;

sub infix:<+> ($left,$right) {
   return 100 * ($right/$left -1);
};

$pugs ./p6test.p6

returns with
50

But if I change the + character to (say) a cyrillic letter Д, I get the following error:
$ pugs ./p6test.p6
***
   unexpected "\1041"
   expecting operator or ")"
   at ./p6test.p6 line 1, column 5


I also tried other latin characters, but I get errors. It seems I can change an existing operator, but not introduce another.

What am I doing wrong?

Reply via email to