Again with the metamodel stuff :P

So, I am trying to implement the submethods correctly, and some questions occurred to me.

The concept of non-inherited infrastructural methods is fairly simple to accomplish in the meta-model, by just giving submethods their own dispatch table inside the metaclass. However where I am somewhat confused is in how and when they get called.

Take this example for instance:

class Foo {
        method bar () { ... }
        submethod bar () { ... }
}

Is this an error (Synopsis 12 seems to indicate it is *not* an error)?

When I call bar() on an instance of Foo, which is called? The method? or the submethod? Is it somehow dependent upon the calling context? (called from within the class, or from outside the class). Take for instance, this example:

class Foo {
        method bar () { ... }
        submethod bar () { ... }

        method baz ($self:) {
                $self.bar() # which one does this call?
        }
}

Or are both called? if so, in what order? On method resolution, should I first check the submethod table? or the method table (and on up the superclass chain)?

Thanks,

Stevan

Reply via email to