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 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!caip!nike!ucbcad!ucbvax!ICSE.UCI.EDU!milne From: milne@ICSE.UCI.EDU (Alastair Milne) Newsgroups: net.lang.ada Subject: Re: Enumerated "procedural" parameters Message-ID: <8606220749.AA27775@ucbvax.Berkeley.EDU> Date: Sun, 22-Jun-86 03:49:52 EDT Article-I.D.: ucbvax.8606220749.AA27775 Posted: Sun Jun 22 03:49:52 1986 Date-Received: Tue, 24-Jun-86 03:58:36 EDT References: <4700042@ada-uts> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: Using an enumeration-indexed case to choose the procedure to be called will work if all the procedures to be called are known and available at the time that case is compiled. It will therefore work if all the enumeration-passing calls are in the same program unit as the case, or if they are exported by a package which will permit only "procedures" known to it (its own, or others from packages used in the specification) to be passed in. It will not work in a library package exporting routines to be applied to routines from units not known to the package. Routines that come to mind immediately are in the field of numeric analysis: curve fitting, best fits, adaptive quadrature, etc. . In these cases what one needs is a routine which, given some routine x to produce original function values, calls that routine as it needs for input to its own algorithm. Such packages would be essential parts of libraries for numeric analysis. Their routines could be applied to any data-producing routine a user supplied, with algorithms 50 years old or produced yesterday. But in Ada, the old approach of simply passing that routine as another parameter is not available. A good point has already been made on this board that in using Ada, one can find that the way one used to do something is no longer available, only to discover that it can be done in new and superior, more secure ways. I hope that will turn out to be so of this case. Alastair Milne