comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Language lawyer question: Equality on 'Access attributes
Date: 08 Jan 2004 16:04:17 -0500
Date: 2004-01-08T16:04:17-05:00	[thread overview]
Message-ID: <wccn08yqhim.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 6bSdnYBKy_diPGCi4p2dnA@gbronline.com

Ze Administrator <groleau+news@freeshell.org> writes:

> Robert A Duff wrote:
> >>3.10.2(24), X'Access does *not* necessarily return any sort of type
> >>implicitly defined by the language (for which no comparison operations
> >>would be defined).  The wording of this clause is:
> >>
> >>   The type of X'Access is an access-to-object type, as determined by
> >>   the expected type.
> >>
> >>The way I read this is that the type of X'Access is the expected type,
> >>which could be a program-defined type, which *would* have comparison
> >>operations defined for it.

First of all, I didn't write the above.  Note the number of ">"'s.

> I'd rather agree with Robert Eachus.  If 'X' and 'Y' are
> both Integers, then X'Access obviously has to be a named
> or anonymous type that is an access Integer.  Problem is,
> there could be a dozen named types visible at that point
> which are defined that way.

In which case, there would be many "=" operators visible,
and the expression would be ambiguous.

>...Some of them could be limited.

There's no such thing as a limited access type.  ;-)
Probably there should be, but that's another story!

> You are asking the compiler to arbitrarily pick any visible
> non-limited 'access Integer' type, and use it for the comparison.

No.  If there are more than one "=" visible that take access-to-integer,
then it would be ambiguous.  In the example given, there was only one
such "=".  The point is, resolution of "=" is just like any other
subprogram.

There's no question of "arbitrarily picking" a type.  For one thing, the
compiler is picking an "=" function, not a type.  And for another thing,
the compiler is *not* expected to think, "well, all those = operators
are basically the same thing anyway, so I'll just pick one arbitrarily".

If you don't believe this is what the RM says (which was the original
question), you should quote chapter and verse.  (I admit that this is a
subtle area -- I could be wrong.)  On the other hand, if you don't
*like* what the RM says, please explain why "=" should behave
differently from other subprograms.

Note that various features *do* behave differently.  For example, as was
pointed out by somebody, there's a special rule for type conversions.
But "=" is just a function -- sometimes predefined, sometimes user
defined, so what matters is how many are visible, with what parameter
and result types (and, I claim, that's probably a good thing).

- Bob



  reply	other threads:[~2004-01-08 21:04 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-08  2:05 Language lawyer question: Equality on 'Access attributes Adam Beneschan
2004-01-08  7:47 ` Robert I. Eachus
2004-01-08 11:07   ` Dmitry A. Kazakov
2004-01-08 17:18   ` Adam Beneschan
2004-01-08 18:04     ` Robert A Duff
2004-01-08 18:31       ` Ze Administrator
2004-01-08 21:04         ` Robert A Duff [this message]
2004-01-09  4:02           ` Ze Administrator
2004-01-09 23:02             ` Robert A Duff
2004-01-10  2:56               ` Ze Administrator
2004-01-09  4:06           ` Ze Administrator
2004-01-09 23:05             ` Robert A Duff
2004-01-10  3:03               ` Ze Administrator
2004-01-10 13:47                 ` Marin David Condic
2004-01-10  7:19               ` Robert I. Eachus
2004-01-10 19:09                 ` Robert A Duff
2004-01-11 14:27                   ` Robert I. Eachus
2004-01-11 21:42                     ` Ze Administrator
2004-01-12  5:16                       ` Robert I. Eachus
2004-01-09  1:28         ` Adam Beneschan
2004-01-09  4:10           ` Ze Administrator
2004-01-09 11:27             ` Dmitry A. Kazakov
2004-01-09 23:09               ` Robert A Duff
2004-01-10 11:56                 ` Dmitry A. Kazakov
2004-01-10 17:08                   ` Robert I. Eachus
2004-01-10 18:40                   ` Robert A Duff
2004-01-09 23:08             ` Robert A Duff
2004-01-10  7:39               ` Robert I. Eachus
2004-01-08 20:36       ` tmoran
2004-01-08 21:06         ` Robert A Duff
2004-01-09  0:27       ` Randy Brukardt
2004-01-09  1:23       ` Adam Beneschan
2004-01-09  1:38         ` Robert A Duff
2004-01-09  6:16       ` Robert I. Eachus
2004-01-09 23:27         ` Randy Brukardt
2004-01-10 16:37           ` Robert I. Eachus
     [not found] ` <hmfvc1-f73.ln1@beastie.ix.netcom.com>
     [not found]   ` <l7v1d1-n33.ln1@beastie.ix.netcom.com>
2004-01-09 23:19     ` Robert A Duff
2004-01-09 23:21     ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2004-01-09  5:48 christoph.grein
2004-01-09  6:03 christoph.grein
replies disabled

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