3 ms·
It should maybe noted that all operators in Raku (excapt the short-circuiting || and && and friends) are in fact "user" defined operators. They just happen to
by lizmat 6y ago
It should maybe noted that all operators in Raku (excapt the short-circuiting || and && and friends) are in fact "user" defined operators. They just happen to be defined already every time you start a Raku program. But code-wise, there is no difference!
Re operator overloading: you could argue you could also do that in Raku, but generally it is about adding functionality. See e.g. the Interval module, which adds "interval" knowledge to the standard DateTime object. It also adds functionality to the + and - infix operators. See: https://modules.raku.org/dist/Interval/lib/Interval.pm6 https://modules.raku.org/dist/Interval/lib/Interval.pm6