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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Formal Subprogram Access Date: Tue, 13 Feb 2018 18:47:58 -0600 Organization: JSA Research & Innovation Message-ID: References: <22dc19b9-ed5f-464a-bd56-87bd9e16c23a@googlegroups.com> Injection-Date: Wed, 14 Feb 2018 00:47:59 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="17951"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:50435 Date: 2018-02-13T18:47:58-06:00 List-Id: "AdaMagica" 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.