On Mon, Sep 24, 2001 at 05:29:16PM -0400, Guido van Rossum wrote:
> > PMCs will bear more than a passing resemblance to PyObjects, when
> > implemented. The main difference is that we won't use the indirection
> > of a PyTypeObject, but will use a vtable pointer directly.
> 
> Ah, but a PyTypeObject isn't an indirection.  It *is* the vtable (with
> a suitable header to make it look like an object).

Oh, cool; so it is. There's still another dereference for the method suites,
but I think I proposed doing something like that for Parrot regardless because
it looked like a useful abstraction. (Duh, of course it's a useful
abstraction, or else you wouldn't be doing it.) Hey, Dan, look at that...

I was, however, under the impression that there are subtle differences: I
don't know how easy it is to create something "subclassed" from a type object
- our equivalent would (currently) be copying the struct and then putting your
own function pointers in there. 

The other subtle difference, now that I think about it, is a bug in Parrot; I
wasn't planning to garbage collect vtables the same way that we GC PMCs. But
if we're allowing people to muck about with them and copy them and create
their own, we're going to need to.

OK, so PMCs could well look more like PyObjects than I first thought. :)

-- 
It's a testament to the versatility of the human mind that we're so able
to compensate for our own incompetence.
    - Darrell Furhiman

Reply via email to