ralph wrote:

It's clear you could have come up with
something like one of these:

    method f ($a, $b) is invoked_by($self)
    method f ($a, $b) is invoked_by($self is topic)
    method f ($a, $b) is invoked_by($_)

but you didn't. Any idea why not?
Because most methods need some kind of access to their own invocant,
but relatively few subroutines need access to the upscope topic.
So the syntax for invocant specification should be compact,
and the syntax for external topic access should be less so.

Moreover, because the latter mechanism compromises the lexical
scoping of the upscope topic, it ought to be marked very clearly
(i.e. with a keyword, rather than a single colon).


   method f ($self : $c : $a*, $b) { ... }

(where * is short for 'is topic'.)
Too short, IMHO.

For such a non-standard method definition, I'd *very* much rather
maintain a syntax like:

	method f ($self : $a is topic, $b) is given($c) { ... }

which clearly marks all the irregularities.

Not to mention that this more explicit syntax doesn't inject a spurious
pseudoparameter into the parameter list.

Damian

Reply via email to