>>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:

>> Is all that really necessary? Why not a non-vtbl function that knows how
>> to add numeric types?

DS> Which numeric types? Int? BigInt? Num? BigNum? Complex numbers? One of the 
DS> reasons to go with the vtable stuff is to allow for smaller, targeted 
DS> routines. More code overall, but less that needs to be dealt with at any 
DS> one time. (More specifically, more of the code for each function that gets 
DS> loaded into the cache gets used)

A generic add/sub/mul/div routine. (This code would have to be common between
all the specific cross-add code anyway.) This would know how to promote the
two operands.

>> I would have wanted to limit the vtbl to self manipulation functions.
>> Set, get, convert, etc. Cross object operations would/should be
>> outside the realm of the object. (It seems like trying to lift yourself
>> by the bootstraps.)

DS> No, a lot of the cross-scalar manipulations can be handled this
DS> way as long as you provide for an "other" slot for any scalar that
DS> doesn't fall within the realm of things we have specific routines
DS> for.

(I'm no OO programmer) I can't wrap my mind around how one can extend a
OO hierarchy so that a low level (i.e. closer to the base class) can know
about a future type. (I once tried to work through the Smalltalk hierarchy
but I got lost.)

<chaim>
-- 
Chaim Frenkel                                        Nonlinear Knowledge, Inc.
[EMAIL PROTECTED]                                               +1-718-236-0183








Reply via email to