On Jul 23, 2005, at 17:46, Klaas-Jan Stol wrote:
> I've been in situations that you would want to call the superclass'
> constructor from the child's constructor, this is handy in situations
> that you want to add some extra things to the constructor, and you
> don't want to duplicate the code. So, in my opinion it would be handy.
> A somewhat related point to this, as well as related to an earlier
> question of mine wrt implementing PMCs in PIR; is it possible to
> access the internal datastructure of the PMC in PIR? So, for example,
> if you would want to set/get the integer value of a PMC in PIR, how
> would you do that? (or will there be supporting syntax for that?)
Exactly as I"ve shown above with the string access. A ParrotObject
subclassed from a PMC has an instance of that PMC as it's first
attribute - named '__value'.
If the object is created from a class w/o a PMC parent (i.e. with the
newclass opcode) you have to implement all the vtables in PIR and store
the information in some attribute, you have to create too.