On Mon, 14 Aug 2000, Larry Wall wrote:

> Nick Ing-Simmons writes:
> : >It's not clear to me whether the intrinsic types should have a different
> : >solution to this than the extrinsic types.
> : 
> : _This_ thread is about using vtables for intrinsic types. If we cannot 
> : make them work there then the proposed innermost SV * replacment is flawed.
> 
> Sure, but we may have to warp our ideas of what a vtable is to encompass
> the notion of a vtable that is the cross-product of two vtables.

I was thinking of requiring some guaranteed coercions (int, float, byte
buffer, and utf-8 stream, at least), and bundling the equality checking
into the vtables of the variables. That way when you did something like:

  if ($foo == $bar)

it gets translated into (in real rough pseudocode....:) :

  $foo->vtable[eq]->($foo, $bar);

$foo's equality vtable entry would force $foo into a type it liked and
check against it. I'm tempted to have a 'same' operator that checks to see
if two variables are actually the same, not just equivalent.

The big problem here is the large number of operators that need to
be supported in every vtable. On the other hand, it means we whittle
ourselves down to only one operator opcode. ;-)

                                        Dan

Reply via email to