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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,72113392dc4997bd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-22 09:49:21 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn14feed!wn13feed!worldnet.att.net!207.35.177.252!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Message-ID: <3EA56F02.5090806@cogeco.ca> From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Subprogram Pointer in a Generic References: <1ftiuys.1twhum2q9qa00N%claveman@grzorgenplatz.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 22 Apr 2003 12:34:10 -0400 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1051029248 198.96.223.163 (Tue, 22 Apr 2003 12:34:08 EDT) NNTP-Posting-Date: Tue, 22 Apr 2003 12:34:08 EDT Organization: Bell Sympatico Xref: archiver1.google.com comp.lang.ada:36352 Date: 2003-04-22T12:34:10-04:00 List-Id: 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