The good news is that the infrastructure's in place to do delegated method calls for vtable functions with objects. So you can actually do something like:

 .sub __MAIN prototyped
  .param pmc argv
  .local pmc foo
  .local pmc bar
  .local pmc asub

  newclass P1, "Foo"
  find_type I0, "Foo"
  newsub asub, .Sub, _foo
  store_global "Foo", "__get_string", asub

  print bar
  end
 .end

 .sub _foo prototyped
  print "In foo!\n"
  .pcc_begin_return
  .pcc_end_return
 .end

and expect it to print out "In foo!" like it ought. That is a cool thing, and we get to do it by subclassing delegate.pmc.

The bad news is that, since all the methods in delegate.pmc are generated by library code and don't appear in delegate.pmc, you can't actually subclass from it properly. (I had to hack parrotobject.c to make it work)

It would be a Good Thing if someone who knows what the heck's going on in pmc2c2.pl and/or lib/Parrot/Pmc2c.pm could thump this into working. I'm trying and, well, it's a twisty maze of undocumented methods, and generally a nasty mess. (I think. It might be terribly clean, but in that case the documentation is even more sorely lacking)
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to