Raku operator overloading
<5 0 10>
literally constructs a List
, a single List
.
An analogy would be a list of things to do, a todo list. How many things is a todo list? It's 1 -- one todo list.
Thus you get the error message:
expected 3 arguments but got 1
What you want is to specify that you want one value that is itself made up of several values. Here's one way to do that:
sub circumfix:<α ω>( ( $a, $b, $c ) ) ...
The additional surrounding (
and )
cause destructuring.
D:\>6e "say <5 0 10>"
(5 0 10)
These aren't three arguments. It's a list of three values (of type IntStr
) and therefore a single argument.