Raku Programming/Operator Overloading
(Redirected from Perl 6 Programming/Operator Overloading)
There are only 5 types of operators: infix , prefix , postfix , circumfix and postcircumfix .
You can declare a new operator like this:
sub postfix:<!>(Int $n!) { [*] 1..$n }
say 5!; # prints 120
The above, as you can see, declares an operator '!' for calculating factorial of a Integer.