From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Formal Subprogram Access
Date: Tue, 13 Feb 2018 18:47:58 -0600
Date: 2018-02-13T18:47:58-06:00 [thread overview]
Message-ID: <p600vv$hgv$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: dfb02e95-8bcd-4226-84d5-39bd20243421@googlegroups.com
"AdaMagica" <christ-usch.grein@t-online.de> wrote in message
news:dfb02e95-8bcd-4226-84d5-39bd20243421@googlegroups.com...
> RM 6.3.1(9) Attribute subprograms have convention Intrinsic.
> RM 8.5.4(5/3) Intrinsic subprograms must not be renamed.
> RM 12.6(9) In an instance, a formal_subprogram_declaration declares a
> view of
> the actual. The profile of this view takes its ... calling
> convention from the original profile of the actual entity.
>
> It seems that attribute subprograms are allowed as actuals.
>
> So again: Is 'Access and renaming of a formal subprogam allowed? It might
> be an attribute.
RM 12.3(11): Legality Rules are not enforced in the body of an instance.
Ergo, the actual subprogram is irrelevant as to whether 'Access is allowed
in a generic body.
There is a special rule for that case in 3.10.2(38/3), and that rule
explicitly allows 'Access to be passed as an anonymous access type. Nothing
in 6.3.1 or anywhere else says that a generic formal subprogram has
convention intrinsic. So I conclude this is legal -- in a generic body.
The rules about the instance only apply in a generic specification, so if
the 'Access is given in the specification, then the 'Access might later be
illegal.
In either of these cases, renaming it (as a spec) does not change any of
these properties. (A renames-as-body is more like a call, so it could change
these properties, as a wrapper is required in any case.)
But a better solution in general is to avoid 'Access altogether -- then you
don't need a panel of experts to argue about whether it is legal or not. ;-)
Randy.
next prev parent reply other threads:[~2018-02-14 0:47 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-09 22:11 Formal Subprogram Access Jeffrey R. Carter
2018-02-10 3:03 ` Randy Brukardt
2018-02-10 9:57 ` Jeffrey R. Carter
2018-02-13 5:51 ` Randy Brukardt
2018-02-13 9:24 ` AdaMagica
2018-02-13 9:41 ` Dmitry A. Kazakov
2018-02-13 10:28 ` AdaMagica
2018-02-14 0:47 ` Randy Brukardt [this message]
2018-02-14 8:19 ` Dmitry A. Kazakov
2018-02-14 10:01 ` Jacob Sparre Andersen
2018-02-14 11:07 ` Dmitry A. Kazakov
2018-02-13 12:24 ` Simon Wright
2018-02-14 0:53 ` Randy Brukardt
2018-02-14 14:36 ` Simon Wright
2018-02-15 4:56 ` Randy Brukardt
2018-02-15 13:12 ` Simon Clubley
2018-02-15 16:38 ` Simon Wright
2018-02-15 18:40 ` Simon Clubley
2018-02-15 16:19 ` Simon Wright
2018-02-15 23:03 ` Randy Brukardt
2018-02-13 17:34 ` Jeffrey R. Carter
2018-02-13 18:31 ` AdaMagica
2018-02-14 0:57 ` Randy Brukardt
2018-02-10 14:55 ` AdaMagica
2018-02-21 17:51 ` Jeffrey R. Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox