From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,72113392dc4997bd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-17 16:21:45 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Subprogram Pointer in a Generic Date: Thu, 17 Apr 2003 18:14:02 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <1ftiuys.1twhum2q9qa00N%claveman@grzorgenplatz.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:36263 Date: 2003-04-17T18:14:02-05:00 List-Id: 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.