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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c9e3d58bccd981dd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!u-picardie.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Defaults for formal subprogram Date: Wed, 28 Apr 2010 16:12:14 -0500 Organization: Jacob Sparre Andersen Message-ID: References: <629d4f19-6d99-4c4e-bffa-2a2b287410eb@u34g2000yqu.googlegroups.com> <9ac3f3db-819c-4232-b580-30a67411dd70@c21g2000yqk.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1272489137 19868 69.95.181.76 (28 Apr 2010 21:12:17 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 28 Apr 2010 21:12:17 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-RFC2646: Format=Flowed; Original Xref: g2news2.google.com comp.lang.ada:11240 Date: 2010-04-28T16:12:14-05:00 List-Id: "AdaMagica" wrote in message news:9ac3f3db-819c-4232-b580-30a67411dd70@c21g2000yqk.googlegroups.com... >> procedure Aaa is >> >> type Proc_Ptr is access procedure; >> >> X : Proc_Ptr; >> >> generic >> with procedure Bbb is X.all; >> -- aaa.adb:8:31: expect valid subprogram name as default >> package Pkg is >> end Pkg; > >AARM 12.6(5.b) The evaluation of the default_name takes place during >the elaboration of each instantiation that uses the default, as >defined in 12.3, �Generic Instantiation�. > >So I don't see a problem. I agree, I think this is legal as the language is written. I know from experience that most compilers have problems with dynamic subprogram names showing up in unusual contexts. For instance, the ARG decided to make such names illegal for the specification of stream attributes because of the near impossibility of writing anything useful with a dynamic name (most compilers didn't support it anyway). But in this case, it seems as if it could be useful, so presumably it is just a compiler bug. Randy.