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,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-16 18:55:43 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!claveman From: claveman@grzorgenplatz.net (Charles H. Sampson) Newsgroups: comp.lang.ada Subject: Subprogram Pointer in a Generic Date: Wed, 16 Apr 2003 18:53:56 -0700 Organization: NetHere Inc. Message-ID: <1ftiuys.1twhum2q9qa00N%claveman@grzorgenplatz.net> User-Agent: MacSOUP/2.4.6 Cache-Post-Path: news-1.nethere.net!unknown@ppp-207-167-100-190.sndg-pm4-2.dialup.nethere.net X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:36223 Date: 2003-04-16T18:53:56-07:00 List-Id: I'm using a procedure that takes a procedure pointer as an argument. It's pretty standard stuff: type Parameterless_Proc_Ptr is access procedure; procedure Register (The_Proc : in Parameterless_Proc_Ptr); My problem occurs when I want to call this procedure from within a generic package. I can't, because 3.10.2(32) says "If the subprogram denoted by P [the prefix of 'Access] is declared within a generic body, S [the access-to-subprogram type of the formal parameter] shall be declared within the generic body." Now that's no good for me at all, so I've kludged my way around it by taking the address of the actual argument procedure and changing it to a pointer using Unchecked_Conversion, a technique guaranteed to work for the current version of my current compiler on my current target machine. 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? Charlie -- For an email response, my real user name is csampson and my ISP is inetworld.net.