From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.etla.org!feeder.erje.net!2.us.feeder.erje.net!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!newsfeed-00-ls.mathworks.com!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Comparing Access Types Date: Sat, 18 Nov 2017 17:01:36 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell02.theworld.com Mime-Version: 1.0 Content-Type: text/plain X-Trace: pcls7.std.com 1511042495 19329 192.74.137.72 (18 Nov 2017 22:01:35 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Sat, 18 Nov 2017 22:01:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:W/cISnqUeuBJcF/CIm9+UZ07WiE= Xref: feeder.eternal-september.org comp.lang.ada:48997 Date: 2017-11-18T17:01:36-05:00 List-Id: "Randy Brukardt" writes: > "Robert A Duff" 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