I have some questions regarding defining bareword operators in Raku. As it stands in the language, there are a variety of bareword operators, such as div, mod, gcd, & lcm. As I'm curious about the capabilities of this langauge, I am attempting to implement Dice Notation via the infix:<d> syntax like so:
sub infix:<d>(Int $x, Int $y) {
return (1..$y).roll($x)
}
But whenever I attempt to use something like 2 d 10, the compiler interprets it as a term, rather than an operator.
Is it even possible to define bareword operators in the first place, and if so, how can I do such?
I would also like to note that I have only tested the above code in the REPL.