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

Srinivas Nayak sinu.nayak2001 at gmail.com
Wed Feb 20 06:36:32 CET 2013


Now I understood...

But what is the need of it?
Why we need to access one thing by two other things?

Looks like, at some point in programming,
1. we are trying the break the scoping rules and access it from outside.
2. we are trying to make an efficient way to pass by value.

Can't it be done using aliases?
Is Oberon free from the nastiness of pointers as we found in C?

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,
> 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
>>
>
> --
> 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