Andy Lester wrote:

What about when you want to implement things like, element -1 gets the last element of the array? That's the case in some languages, I believe...

Yes, but we're talking about returning the number of elements in a PMC. That should never be negative.

Unless someone wants to write a PMC that does return a negative number for VTABLE_elements and have that number be significant in some way.

The vtable functions define a standard interface for all PMCs and they use a standard set of types: INTVAL, FLOATVAL, STRING*, and PMC*. These, unsurprisingly, directly correspond to the register types. That's an intentional part of the design.

Allison

Reply via email to