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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7f9c4ba3b0dc13ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-14 04:33:30 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!rutgers!sgigate.sgi.com!olivea!hookup!news.kei.com!bloom-beacon.mit.edu!news.bu.edu!inmet!asp!mg From: mg@asp.camb.inmet.com (Mitch Gart) Subject: Re: Addressing functions Message-ID: Sender: news@inmet.camb.inmet.com Organization: Intermetrics, Inc. X-Newsreader: TIN [version 1.1 PL8] References: <3citrc$bb5@earth.usa.net> Date: Wed, 14 Dec 1994 12:33:30 GMT Date: 1994-12-14T12:33:30+00:00 List-Id: Bill Buckley (wbuckley@earth) wrote: : : High Ada lovers, Presumably you mean "Hi" not "High" but who knows? : I've got a question on storing subprogram address in : Ada. I know I can get the address of a subprogram via the ADDRESS : attribute in Ada but can not figure a way to use it. I don't have any : immediate need for such a procedure but it has my old C-C++ courisity : wondering. For instance if I were to have an array of subprogram addresses : A(1..2) => (1 => Print1'ADDRESS, : 2 => Print2'ADDRESS); : how could I implement the calling these functions (note : I know the : syntax above is wrong but can't get this simple editor to back up to : change it). I have heard from several other Ada programmers that this : may not be possible. : -- : Bill Buckley :-) Not possible in Ada '83, at least not possible using standard Ada. Your compiler vendor may provide a non-standard way to do it. Ada 95 has "access procedure" and "access function" objects which will do what you want. Mitch Gart