POV-Ray : Newsgroups : povray.off-topic : Binary trees, branches and leaves : Re: Binary trees, branches and leaves Server Time
4 Sep 2024 15:22:01 EDT (-0400)
  Re: Binary trees, branches and leaves  
From: Invisible
Date: 5 Mar 2010 09:03:56
Message: <4b910f4c@news.povray.org>
>> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.