Moritz Lenz |Perl 6| wrote:
S12 says (in the context of classes):

    my method think (Brain $self: $thought)

(Such methods are completely invisible to ordinary method calls, and are
in fact called with a different syntax that uses ! in place of the .
character. See below.)

And later on, in the context of roles:

    my method !foo ...
    my method foo ...   # same, but &foo is aliased to &!foo

Am I right in assuming that the second example is valid only for roles?

I find this different syntax for classes and roles quite confusing. Is
it intended that way? I'd welcome a uniform syntax.


I've asked about "my method foo" too, but had no response. I would not think anything is unique to roles, rather, stuff defined in a role is remembered partly-digested and spilled into a class later. You might want to look at what I've got thus far in my specdoc at <>. I plan on updating that section soon, but you get the idea of the formalism I'm bringing to it.


Reply via email to