Overloaded operators: Difference between revisions

Content added Content deleted
(→‎{{header|Raku}}: Add a Raku example)
Line 158: Line 158:
Borrowed from the [[Nimber_arithmetic#Raku|Nimber arithmetic]] task:
Borrowed from the [[Nimber_arithmetic#Raku|Nimber arithmetic]] task:


New operators, defined in place. Arity is two (almost all infix operators are
New operators, defined in place. Arity is two (almost all infix operators
take two arguments), precedence is set equivalent to similar existing operators,
take two arguments), precedence is set equivalent to similar existing operators,
default (right) associativity. The second, ⊗, actually uses itself to define
default (right) associativity. The second, ⊗, actually uses itself to define