comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Bug in Ada (SuSe 10.2) ?
Date: Thu, 6 Mar 2008 09:46:50 -0800 (PST)
Date: 2008-03-06T09:46:50-08:00	[thread overview]
Message-ID: <96803815-90ec-4798-8202-4f26cc7103f2@i12g2000prf.googlegroups.com> (raw)
In-Reply-To: fq4vce$uh6$1@jacob-sparre.dk

On Feb 27, 4:30 pm, "Randy Brukardt" <ra...@rrsoftware.com> wrote:

> Why do you think a compile-time message is a bug? I've convinced myself that
> it is correct. Look at the body of WoW closely:
>
>     function WoW (Slats: access AirSpeed) return Int_Access is
>     begin
>          return Slats.Altitude'Access;
>     end WoW;
>
> Since Slats is an access value, this is really a dereference. That is, the
> return statement really is:
>
>          return Slats.all.Altitude'Access;
>
> And you lose the special (dynamic) accessibility with the dereference. Thus,
> you get a static check (which fails in this case).

I wasn't paying much attention to this thread; but I've had an
occasion to take a second look at this, and this doesn't seem right.
3.10.2(15) says that the accessibility level of a view of a
dereference is the same as the accessibility level of that of the
access type, which in this case is the anonymous access type of the
access parameter.  And 3.10.2(19) says that the "statically deeper"
relationship doesn't apply to the accessibility level of the anonymous
type of the access parameter; I would think 3.10.2(19) would apply
equally to the dereference (Slats.all) as it does to the parameter
(Slats), since 3.10.2(15) says their accessibility levels are the
same.  In other words, I don't see from the RM how a dereference
causes you to lose the dynamic accessibility check.

Now I know that I don't get 3.10.2 right all the time---I've
embarrassed myself more than once on Ada-Comment by misinterpreting
this section.  And sometimes I just miss rules.  But if I'm wrong, and
I haven't missed a rule, then this is disturbing, because it means
that the legality of a certain fairly simple construct can't be
determined by reading the RM---it requires some subtle interpretation
that is accessible (no pun intended) only to a select few.

In any case, I don't see any reason why the construct in the above
example shouldn't be legal (with a dynamic check); the functionality
seems useful and not at all dangerous.

                                   -- Adam



  parent reply	other threads:[~2008-03-06 17:46 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-19  8:47 Bug in Ada (SuSe 10.2) ? Reinert Korsnes
2008-02-19  9:08 ` Niklas Holsti
2008-02-19  9:53   ` Reinert Korsnes
2008-02-19 11:21     ` Ludovic Brenta
2008-02-20 12:41       ` Reinert Korsnes
2008-02-20 16:50         ` Adam Beneschan
2008-02-20 18:31           ` Jeffrey R. Carter
2008-02-20 23:10             ` Adam Beneschan
2008-02-20 23:22             ` Adam Beneschan
2008-02-21  0:31               ` Randy Brukardt
2008-02-21  8:56                 ` Jean-Pierre Rosen
2008-02-21  9:08                   ` Alex R. Mosteo
2008-02-21  9:27                     ` Ludovic Brenta
2008-02-21  9:46                       ` billjones6789
2008-02-21 12:27                         ` Access type (mis)use (Was: Bug in Ada (SuSe 10.2) ?) Jacob Sparre Andersen
2008-02-21 19:40                           ` Bob Klungle
2008-02-21 21:25                             ` Jeffrey R. Carter
2008-02-21 21:57                             ` Vadim Godunko
2008-02-21 22:32                         ` Bug in Ada (SuSe 10.2) ? Randy Brukardt
2008-02-22 16:10                           ` billjones6789
2008-02-22 19:21                             ` Georg Bauhaus
2008-02-22 21:29                               ` Vadim Godunko
2008-02-22 21:39                                 ` Robert A Duff
2008-02-23 10:16                               ` billjones6789
2008-02-22 19:52                             ` Randy Brukardt
2008-02-23 10:36                               ` billjones6789
2008-02-26  0:32                                 ` Randy Brukardt
2008-02-26 16:46                                   ` billjones6789
2008-02-26 20:53                                     ` Randy Brukardt
2008-02-27  1:05                                     ` Robert A Duff
2008-02-27 10:06                                       ` billjones6789
2008-02-27 17:49                                         ` Robert A Duff
2008-02-28  0:30                                           ` Randy Brukardt
2008-02-28 15:33                                             ` Robert A Duff
2008-03-06 17:46                                             ` Adam Beneschan [this message]
2008-02-21  0:31               ` Jeffrey R. Carter
2008-02-21  0:35                 ` Jeffrey R. Carter
2008-03-06 11:55                   ` Colin Paul Gloster
2008-02-21  0:55               ` tmoran
2008-02-21  8:08                 ` billjones6789
2008-02-21  9:11                 ` Alex R. Mosteo
2008-02-21 23:01                   ` Randy Brukardt
2008-02-22 16:43                 ` Adam Beneschan
2008-02-22  9:06               ` Stephen Leake
2008-02-22  5:40       ` Gautier
replies disabled

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