Piers Cawley wrote:

I really don't like that fine grained syntax I'm afraid. And I'm not
entirely sure you actually gain anything from it do you?
That's one of the questions we're still pondering. But see below.


I also find myself wondering if functions called with:
$foo.bar($baz)
should be *required* to be singly dispatched on $foo and saying that
mulitply dispatched functions/generics/whatever should look like
normal function calls:

bar($foo, $baz); # May be multiply dispatched
I would say that only C<method>s can be called with the

$obj.foo($arg)

syntax (or one of its variants) and only subroutines with the:

foo($arg, $arg)

syntax (or its variant).

However, the way in which either call is *dispatched* (i.e. statically, polymorphically, or multimorphically) is utterly orthogonal to the way it's *called*. Thus I can readily imagine:

sub foo($param1, $param2) {...} # statically dispatched subroutine
vs:
sub foo($param1: $param2) {...} # polymorphically dispatched sub
vs:
sub foo($param1: $param2:) {...} # multimorphically dispatched sub

and:

method bar($self: $param) {...} # polymorphically dispatched method
vs:
method bar($self: $param:) {...} # multimorphically dispatched method

where C<foo> must always called as:

foo( $arg1, $arg2 );

and C<bar> must always called as:

$obj.bar($arg);

irrespective of the way in which those calls are ultimately dispatched.

Damian

Reply via email to