From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 4 May 93 22:13:55 GMT From: widget!jgg@uunet.uu.net (John Goodsen) Subject: Re: Passing procedures as parameters to procedures. Message-ID: <1993May4.221355.13487@evb.com> List-Id: In article <1993May3.190746.1043@ee.ubc.ca> luisl@ee.ubc.ca (luis linares-rojas ) writes: >Subject: Procedures/functions as parameters to procedures/functions. >Before commiting myself to any long term commitment with the Ada language, >I've been revising its capabilities. There is something that I have not >found so far: how to pass a procedure (or a function) as a parameter to anothe r >procedure (or function). Or, in the same spirit, how to create an array of >procedures. The question is: is there a way of doing this in Ada, and (if so) >how? I'd appreciate any help. If you can't wait for Ada 9X and you need dynamic binding of the procedure to call, then you might also check out how it's currently done in the Xt/Motif bindings which support call by address of Ada procedures from C. Basically, you pass the address of an Ada procedure to an external routine using the 'ADDRESS attribute and have that routine call the Ada routine that was passed to it. Of course, this has the usual side effects of being compiler dependent, etc... but it works in Ada 83. As was pointed out in a previous reply, you'll have this in Ada 9X, if you can wait that long. -- John Goodsen EVB Software Engineering, Inc. jgg@evb.com - Ada & Object Oriented Training/Products (301) 695-6960 - Ada GUI & Graphics Tools and Training - Software Reuse, Process & Environments