comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Comparing Access Types
Date: Wed, 15 Nov 2017 19:13:20 -0600
Date: 2017-11-15T19:13:20-06:00	[thread overview]
Message-ID: <ouionh$g54$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: b3976d73-296f-4958-bfb2-26bf49901a48@googlegroups.com

"Jere" <jhb.chat@gmail.com> wrote in message 
news:b3976d73-296f-4958-bfb2-26bf49901a48@googlegroups.com...
...
> Also, why weren't <, >, <=, >= provided for access types.  Even if the
> representation of an Access type is implementation defined, surely
> those operators could have been defined.

They could have been, but they don't mean anything. One needs "=" and "/=" 
for null checks and direct pointer comparisons.

As Dmitry notes, "<" doesn't have a clear meaning for a segmented machine 
(comparing a code pointer and a data pointer is meaningless). Moreover, 
nothing in Ada says that an access value has to have any obvious 
relationship to a physical machine address. The Ada 83 design considered the 
idea that an access value might be a handle or some other sort of indirect 
value. (That's a bit different for a general access type, but even there the 
values are effectively unordered.)

If you need ordering, use System.Address. Better yet, don't use access types 
or addresses in your public interfaces at all -- your clients will be a lot 
happier for it. (YMMV.)

                                       Randy.





      parent reply	other threads:[~2017-11-16  1:13 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
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 [this message]
replies disabled

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