On Wed, Aug 17, 2005 at 02:42:57PM -0400, Stevan Little wrote:
: I think in a Role, $?SELF would still be the invocant in a method, and 
: $?CLASS would (eventually) bind to the class the role was composed 
: into.

Yes, such things stay generic as long as they need to, and no longer.

: As for submethods, I see them like this:
: 
: submethod foo () { ... }
: 
: is really ..
: 
: submethod foo () {
:       next METHOD unless $?SELF ~~ $?CLASS;
: }
: 
: At least that is how larry explained to me about a month ago.

Can't use ~~ for that, since ~~ implies "does", which is not an
exact class match.  Probably need

        next METHOD unless $?SELF.class =:= $?CLASS;

or some such.  Except that BUILDALL/DESTROYALL have to be able to
invoke submethods on partial objects whose actual class is not the
same as the submethod, so there needs to be some way of forcing
$?SELF to consider itself in $?CLASS temporarily for infrastructural
purposes.  Maybe it's as easy as "temp $obj.class := $tmpclass"
in the BUILDALL/DESTROYALL dispatcher.  I dunno.

Larry

Reply via email to