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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.107.157.6 with SMTP id g6mr408826ioe.8.1518513851839; Tue, 13 Feb 2018 01:24:11 -0800 (PST) X-Received: by 10.157.40.82 with SMTP id h18mr19128otd.13.1518513851764; Tue, 13 Feb 2018 01:24:11 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!w142no1288200ita.0!news-out.google.com!s63ni3078itb.0!nntp.google.com!o66no1281176ita.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 13 Feb 2018 01:24:11 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2003:c7:83cd:cafc:4814:1a8a:8357:80b1; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 2003:c7:83cd:cafc:4814:1a8a:8357:80b1 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <22dc19b9-ed5f-464a-bd56-87bd9e16c23a@googlegroups.com> Subject: Re: Formal Subprogram Access From: AdaMagica Injection-Date: Tue, 13 Feb 2018 09:24:11 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader02.eternal-september.org comp.lang.ada:50411 Date: 2018-02-13T01:24:11-08:00 List-Id: Am Dienstag, 13. Februar 2018 06:51:56 UTC+1 schrieb Randy Brukardt: > "Jeffrey R. Carter" wrote in message > news:p5mflm$ibq$1@dont-email.me... > > On 02/10/2018 04:03 AM, Randy Brukardt wrote: > >> > >> Why do you think this is correct? I can't read 3.10.2(32/5) in a way > >> which > >> would prevent using a formal subprogram in this way (assuming that the > >> profile matches, which is does trivially in this case). Indeed, there is > >> specifically an exception allowing "an anonymous access type of an access > >> parameter." This is RM 6.3.1(9). > > IIRC, you can't take 'Access of some attributes that act as subprograms, > > but you can use them as the actual for a generic formal subprogram. So a > > generic can't take 'Access of a generic formal subprogram. > > There's no such rule in the RM. As Christoph noted, a generic formal > subprogram has convention Ada, 'Access is allowed. If you pass an attribute > to it, you have to wrap it in a real subprogram for this reason. (There is a > lot of code specifically to do this in Janus/Ada, it probably never has been > tested outside of a single ACATS test -- I don't think anyone ever has had a > reason to pass an attribute like Succ as a formal subprogram.) But I found no rule that the generic actual subprogram parameter must not have the Intrinsic convention. And IIRC, I once used the 'Image attribute as actual. So now I'm confused. Is it allowed to take 'Access of a formal subprogram? If the actual is an attribute, it is Intrinsic, so 'Access is not allowed.