I have several multi methods.
All of them have the same first statement, then differ depending on the
signature.
proto seems to be a way to factor out the common statement, and there is
a phrase in the Documentation that * can affect the dispatch, viz:
"You can give the |proto| a function b
It looks like you have spaces in the token { * } can you try it without,
using this {*} instead?
On Mon, Jun 29, 2020, 1:29 PM Richard Hainsworth
wrote:
> I have several multi methods.
>
> All of them have the same first statement, then differ depending on the
> signature.
>
> proto seems to be
After deleting the spaces as suggested, there's a "Positional" too many.
I guess you can rewrite that method declaration as
multi method handle(@s)
or
multi method handle(Positional $s)
and adjust the method's body.
On Mon, Jun 29, 2020 at 7:37 PM yary wrote:
> It looks like you have spaces
a) I don't understand why the white space matters, but clearly it does.
So the token is '{*}' and not braces around a Whatever-star.
b) Removing the space yields the following response.
in string
Cannot resolve caller handle(NewClass:D: List:D); none of these
signatures match:
(NewClass: S
On Mon, Jun 29, 2020 at 8:22 PM Richard Hainsworth
wrote:
> a) I don't understand why the white space matters, but clearly it does. So
> the token is '{*}' and not braces around a Whatever-star.
>
For an explanation see the thread "Playing with protos and phasers" that I
started here three days a
On 2020-06-29 Richard Hainsworth wrote:
> a) I don't understand why the white space matters, but clearly it
> does. So the token is '{*}' and not braces around a Whatever-star.
Yep. Weird, but it's a special token.
> Not sure why the List:D is not being matched to Positional. Is the
> List:D re
@Gianni - thank you.
That works.
The problem in my original code - after removing the whitespace in { * }
- was to have 'Positional @s' instead of 'Positional $s'. Either '@s' or
'Positional $s' work.
Thanks for the rapid feedback.
Richard
On 29/06/2020 19:31, Gianni Ceccarelli wrote:
On