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:57:47 -0600 Organization: JSA Research & Innovation Message-ID: References: <1f226b44-eff5-4d54-bacf-07e2303f1b50@googlegroups.com> Injection-Date: Wed, 14 Feb 2018 00:57:48 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="18255"; 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:50437 Date: 2018-02-13T18:57:47-06:00 List-Id: "AdaMagica" wrote in message news:1f226b44-eff5-4d54-bacf-07e2303f1b50@googlegroups.com... > So taking everything together, and as a generic body assumes the worst, > 'Access should be forbidden for generic subprogram parameters. > > I cannot find such a rule in the RM. Looks like an oversight? I doubt that we could change this at this late date (20+ years) even if it was an original mistake. > Is this worth a note in Ada Comment? Up to you. > As Randy said, generic parameter subprograms should be wrapped in a local > subprogram for 'Access - or do I misinterprete him? No, I said that the *compiler* has to wrap generic actual subprograms. (For Janus/Ada, we have to do that for all subprograms, because of generic sharing and the possibility that the parameters change subtypes, or have a deeper level, or many other things. So this is a non-problem for Janus/Ada in any case.) So far as I can tell, they have to have an Ada convention, so they have the be wrapped if the convention is anything else [and that matters]. Note that the same issue comes up when passing predefined operators (probably a more realistic case). Randy.