[Oberon] FPGA - Simple OOP example

Jörg joerg.straube at iaeth.ch
Thu Aug 16 13:57:14 CEST 2018


No. You need two different entities to store your own methods (self) and those of the imported module (super).
Jörg

> Am 16.08.2018 um 13:52 schrieb Tomas Kral <thomas.kral at email.cz>:
> 
> On Thu, 16 Aug 2018 06:17:06 +0200
> Jörg <joerg.straube at iaeth.ch> wrote:
> 
>> (*3*) BEGIN Texts.OpenWriter(W); NEW(super); Term.InitMethods(super);
>> NEW(self); self^:= super^; self.Write := Write
> 
> Just thinking of leaving out one NEW(), i.e.
> 
>  NEW(self); Clone(self); Get(super); self.Write := Write
> 
>  PROCEDURE Clone(VAR m: Methods); BEGIN m^ = methods^ END ;
>  PROCEDURE Get(VAR m: Methods); BEGIN m = methods END ;
> 
> Not sure if better, also if Clone() and Get() carry the meaning well. 
> 
> -- 
> 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