comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Defaults for formal subprogram
Date: Wed, 28 Apr 2010 16:12:14 -0500
Date: 2010-04-28T16:12:14-05:00	[thread overview]
Message-ID: <hra8bh$jcs$1@munin.nbi.dk> (raw)
In-Reply-To: 9ac3f3db-819c-4232-b580-30a67411dd70@c21g2000yqk.googlegroups.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

"AdaMagica" <christoph.grein@eurocopter.com> 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.





      parent reply	other threads:[~2010-04-28 21:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28  9:57 Defaults for formal subprogram Maxim Reznik
2010-04-28 10:31 ` AdaMagica
2010-04-28 10:53   ` Ludovic Brenta
2010-04-28 10:56     ` Ludovic Brenta
2010-04-28 21:12   ` Randy Brukardt [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox