Thusly did Dan Sugalski inscribe:
At 3:33 PM -0500 1/16/04, Benjamin K. Stuhl wrote:

Dan Sugalski wrote:

I was going to go on about a few ways to do this, but after I did I realized that only one option is viable. So, let's try this on for size:

Vtables are chained. That means each vtable has a link to the next in the chain. It *also* means that each call into a vtable function has to pass in a pointer to the vtable the call came from so calls can be delegated properly. If we don't want this to suck down huge amounts of memory it also means that the vtable needs to be split into a vtable header and vtable function table body.

Downside there is that we have an extra parameter (somewhat pricey) to all the vtable functions.


This is sort of icky. What about dynamically constructing vtables and caching
them?


How would one wrap a vtable, then? If you do this, there's no way to call back into the original (or earlier wrapping) entry.

Other than the special case of :readonly, can you give me an example of when you'd need to, rather than simply writing a PMC class that inherits from some base? I'm having trouble thinking of an example of when you'd want to be able
to do that... After all, since operator overloading and tying effectively _replace_ the builtin operations, what more does one need?


-- BKS

Reply via email to