Re: Expressions versus the value they represent

From: paul c <toledobythesea_at_oohay.ac>
Date: Wed, 21 Apr 2010 00:24:52 GMT
Message-ID: <oBrzn.2412$Z6.149_at_edtnps82>


Reinier Post wrote:
> David BL wrote:
>

>> E.g.  In C++
>>
>>   int x = 10;
>>   int* p = &x;
>>
>> x is not a pointer.  x is a variable that holds the value 10.  p is a
>> pointer variable that holds a pointer value.

>
> Good point. (You must be a good pointer.)
>
> Meanwhile, in Algol 68,
>
> INT x := 10
>
> is a shorthand for
>
> REF INT x = LOC INT; x := 10
>
> i.e. a variable is of type reference to integer (Algol 68 doesn't use
> the term 'pointer'.) This is because
>
> INT x = 10
>
> defines a *constant* x with the value 10. (The original C doesn't have
> constants.) So Algol 68 essentially agrees with paul's terminology,
> except that it uses 'reference' for 'pointer'.
>

Yes, if you change the terms of reference, I'd bet you could always turn the meaning of a term into something that is contrary on some surface or other. It always seemed to me that a C "variable" had effectively the same result as a pointer did, perhaps because in my case the programming background was assembler, so even when I look at C code, I see the registers being loaded, either by an interpreter or effectively by a compiler. If I had started with C, maybe my life would have been more complicated because instead of registers I'd have a whole bunch of other concepts to master, such as "holding a value"! Can't prove it but I suspect most problems of this kind will be solved when enough generations pass, even if others arise. Received on Wed Apr 21 2010 - 02:24:52 CEST

Original text of this message