[Oberon] Oberon for a C++ user.

Lars noreply at z505.com
Wed Sep 28 21:44:17 CEST 2016


On Mon, September 26, 2016 11:14 pm, Skulski, Wojciech wrote:
>> Or would we reinvent object oriented programming if modules
>> could be allocated on the heap?  If we just reinvented objects, now we
>> know exactly what modules are: design time objects without any heap
>> allocation at run time.
>
> You put the module on the heap with its code, because it is the module's
> goal to provide the code. OK. Now you need to execute that code from the
> heap. OK. You allocate another copy of the module on the heap. So you put
> the same executable code on the heap for the 2nd time. Now you can
> execute it. (If you cannot, then allocating the code would make no
> sense.) So now you have two copies of the same executable code on the
> heap. It makes little sense.


But if a module has a global variable that you change, it is now a
different object just as if you change Object.Field to a different value?

i.e. if you can assign variables in the heap module, it now becomes
similar to an object on the heap. Only if you can change the object, and
make it unique to another instance of an object, does it become useful. 
But if it is an exact clone of the other module with no changes, it's
useless and pointless as you say


More information about the Oberon mailing list