comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@TheWorld.com>
Subject: Re: Comparing Access Types
Date: Sat, 18 Nov 2017 17:01:36 -0500
Date: 2017-11-18T17:01:36-05:00	[thread overview]
Message-ID: <wcclgj3z1of.fsf@TheWorld.com> (raw)
In-Reply-To: ouiovq$g6l$1@franka.jacob-sparre.dk

"Randy Brukardt" <randy@rrsoftware.com> writes:

> "Robert A Duff" <bobduff@TheWorld.com> wrote in message 
> news:wccinei14g6.fsf@TheWorld.com...
>>I wrote:
>>
>>> If "=" lies, then the Ada implementation is simply wrong.
>>
>> There were more than one Ada compiler for the 8086,
>> and I'm pretty sure "=" on access values worked
>> properly.  It's really not hard to get it right -- in
>> fact I think the compiler would have to go out of
>> it's way to get it wrong.
>
> I doubt that. It wouldn't have worked "right" in Janus/Ada, ...

I don't believe you.  ;-)

>...for instance, we 
> just did a binary comparison. 

Of course.  That's the only sensible way to do it.

>...So
>
>    C000:DEAD /= CDEA:000D even though they pointed at the same physical 
> memory.

There's no requirement that C000:DEAD = CDEA:000D, so long as "new"
and '[Unchecked_]Access are not producing such weird values.
Just make sure that all access values pointing to the
same object are bit-wise identical.

I stand by me statement: "... the compiler would have to go out of
it's way to get it wrong."

> But you could only run into that if you converted a System.Address into an 
> access value; it would never happen within a correctly running Ada program 

Exactly.  There's no reason for the Ada implementer to worry about
doing weird things with 'Address and Unchecked_Conversion and
the like.  The programmer is required to obey the implementation's
run-time model when using such features.

As you pointed out, access values need not be represented as addresses,
so how could you expect converting addresses to access values
to make any sense at all (unless of course, the implementation
makes promises that go beyond the Ada RM)?

> so we didn't want to pay the extra cost of doing it perfectly right.

I think you did it perfectly right.

- Bob

  reply	other threads:[~2017-11-18 22:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09  5:37 Comparing Access Types Jere
2017-11-09  8:29 ` Simon Wright
2017-11-09  8:33 ` Dmitry A. Kazakov
2017-11-09 22:38   ` Robert A Duff
2017-11-10  8:35     ` Dmitry A. Kazakov
2017-11-10 15:11       ` Jere
2017-11-10 16:05       ` Robert A Duff
2017-11-10 16:30         ` Robert A Duff
2017-11-16  1:17           ` Randy Brukardt
2017-11-18 22:01             ` Robert A Duff [this message]
2017-11-20 22:25               ` Randy Brukardt
2017-11-21  0:30                 ` Shark8
2017-11-21  8:57                   ` Dmitry A. Kazakov
2017-11-22  1:01                     ` Randy Brukardt
2017-11-10 15:20     ` Jere
2017-11-10 16:00       ` Robert A Duff
2017-11-10 16:22         ` Jere
2017-11-10 15:06   ` Jere
2017-11-16  1:21     ` Randy Brukardt
2017-11-16  1:13 ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox