Larry Wall wrote:
> :     ::Takes3Ints ::= :(Int,Int,Int --> Any);
> : 
> :     my &foo:(Takes3Ints);
> I'd say that has to be something like:
>     my &foo:(Takes3Ints:);
> or maybe one of
>     my &foo:(Takes3Ints \!);
>     my &foo:(\Takes3Ints);
>     my &foo\(Takes3Ints);
> since Takes3Ints is the implementation and/or arglist type.

Sorry, you lost me. Why is there a invocant colon in the
first example, and what exactly does the ref indicator
mean in all the three different alternatives?

> Otherwise how do you distinguish
>     my &foo:(Takes3Ints);
>     my &foo:(Int, Int, Int);

You mean the latter &foo as non-code, simple 3-tuple type?
Otherwise I would think the & sigil implies the optional
default &:( --> Any). But than again I haven't fully grasped
your notion of the pure type name before the first colon.

> The colon would still be required in an rvalue context.  But the extension
> of that to subs seems to be:
>     my &sub(Sub: \$args)
> Hmm, does that mean that a method actually looks like this?
>     my &meth(Method: $self: \$args)

I have ranted that I see method invocation as a two step
call with a covariant dispatch first and then a normal
contravariant call with argument type check, but why the
second colon? And why the first on &sub(Sub: \$args)? Just
to name the intended code subtype?

Reply via email to