comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Subprogram Pointer in a Generic
Date: Thu, 17 Apr 2003 18:14:02 -0500
Date: 2003-04-17T18:14:02-05:00	[thread overview]
Message-ID: <v9udo8nfa2vd28@corp.supernews.com> (raw)
In-Reply-To: wccwuhsg8o0.fsf@shell01.TheWorld.com

Robert A Duff wrote in message ...
>If you do the 'Access in a generic, the compiler doesn't know (when
>compiling the generic) whether the instance will be nested.  The AARM
says:
>
>    32.a  Discussion: The part about generic bodies is worded in terms
of the
>          denoted subprogram, not the denoted view; this implies that
renaming
>          is invisible to this part of the rule. This rule is partly to
>          prevent contract model problems with respect to the
accessibility
>          rules, and partly to ease shared-generic-body
implementations, in
>          which a subprogram declared in an instance needs to have a
different
>          calling convention from other subprograms with the same
profile.

Note that this rule was confused in Ada 95 (it prohibited more than
necessary, and didn't prohibit some things that needed to illegal); that
was fixed by AI-229.

The !appendix on that AI gives some more justification for the rule.
There is also an LSN on the subject, which is quoted in AI-254.

>>... (2) Is there a more robust way of working around it?
>
>The solution is easy: declare the procedure you're taking 'Access of in
>the private part of the generic, rather than in the body.  And don't
>instantiate the generic in a nested place.


But that may work right only with a compiler that implements AI-229. The
original rule is more restrictive.

                    Randy.





      reply	other threads:[~2003-04-17 23:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-17  1:53 Subprogram Pointer in a Generic Charles H. Sampson
2003-04-17  2:54 ` James S. Rogers
2003-04-17  3:15   ` Samuel Tardieu
2003-04-17  5:27     ` tmoran
2003-04-17  3:12 ` Samuel Tardieu
2003-04-17  4:17   ` tmoran
2003-04-17 20:24     ` Robert A Duff
2003-04-18  2:59   ` Charles H. Sampson
2003-04-22 16:34   ` Warren W. Gay VE3WWG
2003-04-22 21:17     ` Robert A Duff
2003-04-23 20:46       ` Warren W. Gay VE3WWG
2003-04-17 19:41 ` Matthew Heaney
2003-04-17 20:39 ` Robert A Duff
2003-04-17 23:14   ` 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