Chaim Frenkel <[EMAIL PROTECTED]> writes:
>This discussion of vtbls and how to do cross products has me confused.
>
>I thought there were two different _real_ vtbls and an op tree.
>
>The low-level core 'objects' have a vtbl that handles operations on
>the object itself.
That is the one we are taling about here.
>
>The higher level perl user objects have a vtbl that handles method dispatch.
>Again operations on the object itself.
Not got there yet.
>
>Cross operations, addition, concatination, etc. Are handled in the optree.
That is the poiunt of discussion.
What goes in the op-tree for (say) '*' - it needs to be
fixed but what it needs to do is different depending on types (= vtables)
if the operands.
i.e. given
$a * $b * $c * $d
Where $a is string '42' which needs converting
$b is native integer (easy)
$c is a 64-bit (or more) 'bigint'
$d is floating point.
It _may_ make sense for optree to just "call" the "multiply" entry
from the vtable(s) - assuming that one or more of the types knew
how to multiply itself by the other(s).
Same issue potentially occurs for $a eq $b
where $a is UTF8 and $b is "raw from disk encoded as BIG5" or whatever.
The perl5 scheme was to avoid converting stuff as we read it in case
we just wrote it back out as-was.
>
>I can't see how objectA's vtbl can handle a cross-operation to objectB's
>vtbl.
perldoc overload
Describes _a_ way of doing it - but it is messy.
--
Nick Ing-Simmons <[EMAIL PROTECTED]>
Via, but not speaking for: Texas Instruments Ltd.