comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: Comparing Access Types
Date: Fri, 10 Nov 2017 07:20:20 -0800 (PST)
Date: 2017-11-10T07:20:20-08:00	[thread overview]
Message-ID: <f2752b90-723f-4f9d-9885-9009f26a5bac@googlegroups.com> (raw)
In-Reply-To: <wccpo8rjcwg.fsf@TheWorld.com>

On Thursday, November 9, 2017 at 5:38:41 PM UTC-5, Robert A Duff wrote:
> "Dmitry A. Kazakov" writes:
> 
> > No, in general case it cannot, in the spirit of the semantics that A < B
> > if the physical machine address of A < B.
> 
> I agree with you that "<" makes little sense for access types.
> Even in C, "<" on pointers is undefined unless they point
> into the same array.

I'm not hugely in disagreement here, but I am curious as to why it doesn't
make sense.  My impression of access types is that they hold some sort of
information used to locate/manage an object and that they must be unique
for unique objects (that is two access types pointing to two separate
objects cannot have identical implementation values under the hood). If they
must be unique, there is generally a way to order them.  I'm not suggesting
treating them like integers or even exposing how the ordering is done.

Again, I am not trying to outright disagree, just understand.  In either
case, I think I have given up on ordering them and will let the client
do as Dmitry suggests (comparing the objects they reference for ordering
instead).

For debugging purposes, I do wish there was a way for me to get a printable
unique value for access types.  When I work with incomplete types, 'Address
no longer works (with GNAT at least) and there is no 'Image for access types.
Any thoughts on that? I'm trying to trace the inner workings of a type
that holds access types internally but since the access types are for
incomplete types, I'm having trouble doing that within the generic package.

  parent reply	other threads:[~2017-11-10 15:20 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 [this message]
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