On Wed, Sep 26, 2007 at 01:57:10PM -0500, Patrick R. Michaud wrote:
> On Wed, Sep 26, 2007 at 01:39:51PM -0500, Patrick R. Michaud wrote:
> > This is primarily for Allison, but others can chip in....
> > 
> > 1.  In PIR, if I have an Object in a PMC register, how do I
> >     determine its corresponding Class object?  Is the "standard"
> >     mechanism to use the C<inspect> opcode?
> > 
> >         $P1 = inspect $P0, 'class'      # $P1 is class object of $P0
> 
> In src/ops/object.ops, we have:
>     =item B<class>(out PMC, invar PMC)
>     Get the class PMC for the object in $2 and put it in $1.
> 
> This is exactly what I'm looking for, but it's not currently documented
> in pdd15.  Can this be "made official" one way or the other  -- i.e.,
> "officially adopted" or "officially rejected"?

This ended up being discussed on IRC -- just to complete this thread
I'll note that we settled on the 'typeof' opcode to return the
class (or PMCProxy) object for a PMC:

    $P1 = typeof $P0    # $P1 is class object / PMC proxy of $P0

Pm

Reply via email to