On Mon, Dec 30, 2002 at 04:36:31PM +0100, Leopold Toetsch wrote:

> - a "variable" consists of 3 parts: name, variable, value
> - the 2 latter are now handled in one go in our vtable funcs
> - variable and value access should be separate operations (think tie)
> - 2-stage access (get_var->value->get/set_xxx) can be avoided for plain
>   variables by duplicating the value vtable meths to the var vtable.
> 
> Things to be considered:
> - tied variables
> - references
> - objects
> - aggregates/_keyed access
> - ...
> 
> Proposal for struct _vtable:
>   base_vtable
>   var_vtable
>   val_vtable
>   prop_vtable
>   ...
> 
> base_vtable ... name, type, ...
> var_vtable  ... get_integer, set_integer, ...
> val_vtable  ... add, sub, ...
> prop_vtable ... property functions (set/getprop are different, depending
>                 on the existence of the property hash)
> 
> The vtable pieces and the _vtable container struct should be pointers to
> constant memory, initialized similar to current class_init code.

Effectively a variable ISA value. So shouldn't val_vtable come first, so
that we can create shorter vtables for values, such as values in aggregates?
Or is this vtable just for variables?

Also, if vtable pieces are in constant memory, how do we efficiently create
singleton objects?

Nicholas Clark

Reply via email to