|
![](/i/fill.gif) |
>> Wouldn't you just need to determine the storage requirements of THE
>> LARGEST class of object? And allocate that amount for every object?
>
> No, because indexing is done based on the type of the array. For the
> indexing to work properly the array type would have to be that of the
> largest object type, but then you wouldn't be able to easily store any
> other type of objects there (because now you would be handling objects
> of the most derived class type rather than objects of the base class
> type).
You seem to be looking at "can you do this in an existing language?" I'm
looking at "is it feasible for a hypothetical OO language to support
this efficiently?" I think it could be supported efficiently; I just
can't think of any language which does it.
> Perhaps not *impossible*, but as you may guess, quite hard and kludgey.
Not if it's hard-wired into the language. Then it becomes no less hard
or kludgey than (say) generating the illusion that each program on the
machine has complete control of the entire machine, when in reality the
OS is time-slicing them and sharing memory and I/O resources between them...
Post a reply to this message
|
![](/i/fill.gif) |