comp.lang.ada
 help / color / mirror / Atom feed
From: "Warren W. Gay VE3WWG" <ve3wwg@cogeco.ca>
Subject: Re: Subprogram Pointer in a Generic
Date: Tue, 22 Apr 2003 12:34:10 -0400
Date: 2003-04-22T12:34:10-04:00	[thread overview]
Message-ID: <3EA56F02.5090806@cogeco.ca> (raw)
In-Reply-To: slrnb9s6tn.hvi.sam@willow.dyn.rfc1149.net

Samuel Tardieu wrote:
> Charles H. Sampson wrote:
>>     There are two questions.  (1) What are they trying to prevent by
>>this restriction?  (2) Is there a more robust way of working around it?
> 
> (1) The absence of such a rule would prevent an implementation from
>     implementing efficiently shared generic packages: if, from
>     within the body, you take a reference to a local subprogram,
>     you do not statically know the accessibility "depth", as the
>     generic package may be instantiated locally (from within a
>     subprogram for example).  Note that building the access value
>     from outside the generic package then storing it is subject to
>     the classical static accessibility rules and thus does not
>     require this restriction.
> 
> However, I must admit that I do not understand why it is not
> sufficient for the access to subprogram type to be declared in the
> corresponding generic declaration, as both accessibility levels can
> be statically compared when compiling the generic package body.
> 
> Should this restriction be alleviated in Ada 2005?

I think so. I found this to be a horrible limitation when it
was necessary to register a callback from within a generic.

-- 
Warren W. Gay VE3WWG
http://home.cogeco.ca/~ve3wwg




  parent reply	other threads:[~2003-04-22 16:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-17  1:53 Subprogram Pointer in a Generic Charles H. Sampson
2003-04-17  2:54 ` James S. Rogers
2003-04-17  3:15   ` Samuel Tardieu
2003-04-17  5:27     ` tmoran
2003-04-17  3:12 ` Samuel Tardieu
2003-04-17  4:17   ` tmoran
2003-04-17 20:24     ` Robert A Duff
2003-04-18  2:59   ` Charles H. Sampson
2003-04-22 16:34   ` Warren W. Gay VE3WWG [this message]
2003-04-22 21:17     ` Robert A Duff
2003-04-23 20:46       ` Warren W. Gay VE3WWG
2003-04-17 19:41 ` Matthew Heaney
2003-04-17 20:39 ` Robert A Duff
2003-04-17 23:14   ` Randy Brukardt
replies disabled

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