Re: General semantics

From: Reinier Post <rp_at_raampje.lan>
Date: 26 May 2010 23:15:10 GMT
Message-ID: <4bfdab7e$0$14133$703f8584_at_textnews.kpn.nl>


Erwin wrote:

>On 24 mei, 16:03, r..._at_raampje.lan (Reinier Post) wrote:
>> paul c wrote:
>> I know the term OID only from some database literature, in which it is
>> used for such generated values.  In OO programming, a distinction can
>> be made between pointers, which are addresses in memory and which can
>> be meaningfully added to, and references, which are not and on which
>> the only meaningful operation is equality comparison.
>
>> References are in between pointers and OIDs.
>
>I recognize the importance of the concept of "not using the actual
>physical memory address as the means of identification of any
>object". It gets in the way of memory managers that need to relocate
>stuff.
>
>So I recognize the concept that _inside_ an OO programming machine, it
>is useful to have a kind of mapping table that acts as the sole point
>of contact for any stuff that needs to access/wants to manipulate
>actual physical addresses. I also recognize the concept of calling
>the key in such a table a "reference" and the mapped value in such a
>table a "pointer".

You are thinking in terms of a possible implementation. It's more general and hence more useful to discuss this from an algebraic point of view instead.

>That said, and assuming that is also what you meant, and noting that
>there can be several distinct references mapping to the same pointer
>value, I'd like you to explain to me what exactly the usefulness is of
>"equality comparison of references", which I interpret to mean
>"equality of the key value in said mapping table".

You are interpreting in terms of a possible implementation, but I am not. I don't know if any tables are being kept anywhere. I am merely saying that refererences, like OIDs, are a value domain on which equality comparison is meaningful, but numerical interpretation (e.g. greater than, addition and subtraction) is not. In some OO languages object references do have this property, in others they can still be treated as pointers in some circumstances, yet other languages such as C++ depart from pointers and require strict programming discipline to allow these pointers to be regarded as references in this sence. This is why I say references are (in practice) somewhere in between pointers and OIDs.

>And I'd like you to explain to me how the dereferencing operator on
>such a reference is totally unimportant.

Hmmm ... yes, referencing and dereferencing is possible. I meant to say that treating them as numbers or even as ordered is not.

>I say the only meaningful operation on reference types is
>dereferencing.

But this certainly isn't true. It's important that we can tell the difference betweenaliasing and copying of object values.

-- 
Reinier
Received on Thu May 27 2010 - 01:15:10 CEST

Original text of this message