hello,

sorry if this has been discussed before, I did a quick search in the
Archive and the summaries but can't find a similar topic.

I've just read A12, and while I really like the inherent orthogonality
of the whole object system as it is (will be) implemented, there is
something that puzzles me. from what I read, it seems that every class
will implicitly call "does Dispatch" (which provides a .dispatcher
method) and "is Object" (which provides a .meta method). (or more
probably, class Object "does Dispatch" itself). so, if this is true, I
guess I could never write a class that does:

    class MyClass {
        has LethalWeapon $.dispatcher;
        method meta { say "$_ is doing meta!" }
    }

both of them would make my class pretty useless, I think, since it could
not (correctly, at least) dispatch methods anymore. and I won't be able
to access metadata.

what would Perl6 do in such a case? I think it should complain, and
probably don't let me compile such a class, but what is the underlying
implementation for this? are .dispatcher, .meta (and maybe some others
too) "special" methods that can't be, in any case, overloaded? 

and eventually, can I use a similar mechanism in my own classes, that
is, write a "final" method (something like: you can derive from me
however you like, but you can't redefine this method of mine)?

cheers,
Aldo


Reply via email to