[Oberon] FPGA - Simple OOP example

Jörg joerg.straube at iaeth.ch
Wed Aug 15 21:35:52 CEST 2018


Yes, you’re sbsolutely right.
In my first version I had
TYPE Methods = RECORD Write... END

And then only in the second version, I changed to
 TYPE Methods = POINTER TO MDesc;
and I forgot to change m := methods to m^ := methods^

Jörg

> Am 15.08.2018 um 09:59 schrieb Tomas Kral <thomas.kral at email.cz>:
> 
> On Tue, 14 Aug 2018 19:05:21 +0200
> Jörg <joerg.straube at iaeth.ch> wrote:
> 
>> VAR methods: Methods;
>> PROCEDURE InitMethods*(VAR m: Methods); BEGIN m := methods END
>> Methods;
> 
> EDIT
> 
> Hi, just thinking further, the above assigns a single pointer, but we
> may need to copy all base methods' pointers, that may be
> [overriden] overwritten later.
> 
> How to copy all methods' pointers?
> E.g. like that, correct?
> 
> PROCEDURE InitMethods*(VAR m: Methods); 
> BEGIN m^ := methods^
> END InitMethods;
> 
> Many thanks
> Tomas
> 
> -- 
> Tomas Kral <thomas.kral at email.cz>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon



More information about the Oberon mailing list