On Mon, Nov 07, 2005 at 08:44:28PM +0100, TSa wrote: : HaloO, : : 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,
It would presumably indicate an implementation type for &foo, which is probably wrong. : and what exactly does the ref indicator : mean in all the three different alternatives? Those would indicate an arglist parameter, which is probably right. The most recent S06 has sub foo (\$arglist) to bind the entire arglist object to $arglist, though arguably (no pun intended) the syntax could be: sub foo \($arglist) instead. This goes with the decision that rvalue \(1,2,3,:foo) generates an arglist object. : > 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). The Any would be implied in that case. I don't see much difference between that and the multi disambiguating construct: my &foo := &bar:(Int, Int, Int); say foo(1,1,1); : But than again I haven't fully grasped : your notion of the pure type name before the first colon. I was just playing off of your @array:(Array: ...) thought, but the signature is not the implementation type, so forget that. : > 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? Only because multiple colons imply tiebreaking behavior under MMD. I'm just trying to picture SMD as a form of MMD. : And why the first on &sub(Sub: \$args)? Just : to name the intended code subtype? Yes, just the same as your @array:(FooArray: ...) idea that the first invocant is the function-like object implementing the thing. Larry