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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8cca2e0315177d3b X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Instantiating a generic formal procedure with an access procedure value Date: 2000/01/04 Message-ID: <38725A42.2961CEFC@averstar.com>#1/1 X-Deja-AN: 568295466 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <84guh6$emh$1@nnrp1.deja.com> <3870E3F1.906FDFF4@averstar.com> <84rnbm$8jo$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-01-04T00:00:00+00:00 List-Id: Jeff Carter wrote: > > In article <3870E3F1.906FDFF4@averstar.com>, > Tucker Taft wrote: > > Jeff Carter wrote: > > > procedure Op (Item : in out Handle; Item : in Integer); > > > > I presume you mean ------------------->>> Element : in Integer <<< > > Yes, thanks for pointing out that error. > > > > procedure Iterate (Action : in Action_Ptr) is > > > procedure Local is new S_U.Iterate (Action => ???); > > > -- What do I use here? > > > > Action.all is the name of a subprogram. It happens to have > > convention "protected" but that is irrelevant to a generic > > formal subprogram, which should accept subprograms of any > > convention. > > I don't see why it should have convention "protected", since Action_Ptr > is defined in the spec of package S and the actual procedure pointed to > by a call to Iterate must be declared at the library level. However, > that should be irrelevant. You're right. I don't know what made me think that Action was an access-to-protected subprogram. I must have been seeing things. > s.adb:9:10: instantiation abandoned > s.adb:9:63: missing argument for parameter "Element" > s.adb:11:10: "Local" is undefined > > I realize that 3.12p is current, but I lack the bandwidth to download > it right now. It may be a compiler error, and may be corrected in 3.12p > or in compilers from other vendors, but I'd like confirmation that > other compilers do accept this. Your code compiles fine with My Favorite Front End. This looks like a good old compiler bug. On the other hand, it would still help if you included the complete source code, exactly as it was submitted to GNAT. For example, I am surprised GNAT didn't complain about lack of a generic body. You have included bits and pieces, and it is quite possible that there was some transcription error when I created a compilable version. > > Thanks for taking the time to think about this. > -- > Jeff Carter -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA