At 10:54 AM -0800 2/18/02, Brent Dax wrote:
>Dan Sugalski:
># Details of strings, PMCs, and vtables shouldn't be exposed to people
># writing extensions. Strings and PMCs should be opaque types, and
># vtables shouldn't be exposed at all, to hide the details of the
># implementation. Structure should be completely unexposed.
>#
># Only the core and PMC class authors should see the vtables, and only
># people actually writing them in C. (PMC classes written in
># perl/python/ruby/whatever should see the interface their particular
># HLL exposes)
>#
># Probably a good first step for an extending and embedding PDD, if we
># want just a single one, is to define what's visible where, and what's
># black magic in other places, just so we can keep this stuff straight.
>
>*Sigh*.  Okay, then we'll need a different interface to call vtable
>methods on PMCs from outside.  We can't just say "no, all you can do is
>toss these things around, you can't do anything with them".  Any
>suggestions?

Actually, we can toss things around without letting folks do much with them. :)

What we need to do is make a list of things people will generally 
need to do with PMCs and put together an interface that would let us 
completely yank out the current implementation without affecting any 
extensions.

Getting and setting values, either singly or in aggregate, and 
putting PMCs in other PMCs, is what you'll find 99% of XS code does 
with PMCs. The rest is reasonably abstractable--calling methods on a 
PMC and calling subs are pretty much it for the rest.

A lot of the overloading stuff we can punt on cleanly--as long as the 
extensions name their subs the same way that perl code would, the 
same rules for abstract overloading/tying apply. (Which is to say if 
you write a DESTROY function in the extension, it'll get called at 
cleanup as part of the cleanup vtable call, but the extension doesn't 
need to know a darned thing about the vtable to implement it)
-- 
                                         Dan

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

Reply via email to