[Oberon] [Fwd: RE: objects and jewels]

Douglas G. Danforth danforth at greenwoodfarm.com
Wed Feb 20 06:18:51 CET 2013


Srinivas,
Here is some code as an example

MODULE FooModule;
     TYPE
         MyRecord =    RECORD n: INTEGER; r: REAL END;
     VAR
         a: POINTER TO MyRecord;
         b: POINTER TO MyRecord;

     BEGIN
         NEW(a);
         b := a;
         (*both a and b point to the same memory location*)
END FooModule.

On 2/19/2013 9:13 PM, Srinivas Nayak wrote:
> Dear Douglas,
>
> I didn't get you.
> Will you please elaborate a bit?
>
> With thanks and best regards,
>
> Yours sincerely,
> Srinivas Nayak
>
> Home: http://www.mathmeth.com/sn/
> Blog: http://srinivas-nayak.blogspot.in/
>
>
> Douglas G. Danforth wrote:
>> Srinivas,
>>
>> With a pointer, two (or more) different variables can access the same
>> thing: a numeric value;
>> a record; a record with methods (Object).
>>
>> -Doug Danforth
>>
>> On 2/19/2013 8:17 PM, Srinivas Nayak wrote:
>>> One thing I couldn't understand, what was the need of pointers?
>> --
>> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
>> https://lists.inf.ethz.ch/mailman/listinfo/oberon
>>
> --
> 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