Branden wrote:
[...]
> 
> I also don't see how it wouldn't bang badly if we get an incorrect PMC. How
> would we extract the 5th element of a scalar? And how would we read one line
> out of an array? Sum two hashes? I think having only one vtable for all
> would only put a burden on who implements a vtable to croak an error on not
> supported types.

You seem to be argueing against yourself here. If there is only one vtable
*layout* there will be no problem (at least no crash) if, say, the 5th
element of a scalar is requested, because the scalar *implementation* of the
responsible virtual function will deal with that gracefully (perhaps issue
a warning, or error).

If there are different vtable layouts, very bad things might happen, like
calling a function with the wrong signature 
(e.g. one argument instead of two args, ...) -> crash!

I don't think the burden for the implementors would be great. You could
supply standard "feature-not-implemented" functions, so the they
would just have to enter the address of this function in the vtable. 
Like:

    ...
    &not_implemented_FETCH,
    ...

-Edwin

Reply via email to