I've checked in some objects changes that allow subclassing of (non-ParrotClass) PMCs:

  .local pmc MyInt
  getclass $P0, "Integer"
  subclass MyInt, $P0, "MyInt"
  .local pmc i
. $I0 = find_type "MyInt"
  i = new $I0
  i = 5    # builtin set_integer_native
  print i  # overridden __get_string
  ...
.namespace ["MyInt"]
.sub __get_string method
  $I0 = classoffset self, "MyInt"
  $P0 = getattribute self, $I0         # i.__value i.e. 5
  ...

They get automatically an inital attribute called '__value', which is a PMC of the overridden base type.

I'd like to know, if it's ok so far.

And: Should MMD functions also automagically get redispatched like vtable functions, or ought these to be installed manually like in the last test t/pmc/objects_43.imc?

As reference for now: t/pmc/ojects_38 - 43.imc

Comments welcome,
leo



Reply via email to