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.1 required=5.0 tests=BAYES_20,INVALID_DATE, MSGID_SHORT 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!ll-xn!mit-amt!mit-eddie!genrad!decvax!cca!holden From: holden@cca.UUCP (Russ Holden) Newsgroups: net.lang.ada Subject: Re: ForTran-Ada + flamette + questi Message-ID: <8499@cca.UUCP> Date: Sat, 21-Jun-86 23:00:05 EDT Article-I.D.: cca.8499 Posted: Sat Jun 21 23:00:05 1986 Date-Received: Tue, 24-Jun-86 04:04:48 EDT References: <8129@cca.UUCP> <4700042@ada-uts> Organization: Computer Corp. of America, Cambridge List-Id: I know this has been beaten to death (and put to sleep) but... > >> Rich, you are missing out on the beauty of procedure passing. > >> Simply put it gives you the ability to dynamically bind actions > So does the enumeration-to-procedure mapping method I proposed. > > To be more concrete, the following outlines a package spec which > one could use: > > package Mapper is > > type No_Argument_Procedure_Pointer is ( > proc_A_0, proc_B_0, ... ); > > type One_Integer_Argument_Procedure_Pointer is ( > proc_A_1_int, proc_B_1_int, ... ); > : > > procedure Call ( > p : in No_Argument_Procedure_Pointer ); > > procedure Call ( > p : in One_Integer_Argument_Procedure_Pointer; > i : in Integer ); > : > end Mapper > > The implementation of each "Call" procedure would simply be a case > statement to the appropriate "real" procedure call. There were a bunch of examples better than the ones I provided given during the lengthy discussion about procedure parameters over the past few weeks which point out the insufficiency of this (not to mention its inherent ugliness and limits). Also shown were mechanism for making the checking of procedure parameters quite possible (for example by requiring that procedures used in that manner be strongly typed). > > If anyone could provide an example where a Procedure_Pointer could > not be used wherever one would like to use a "real" pointer to a > procedure in a different langauge, I'd be grateful for a reply. > > Again, I apologize if I'm just being dense, but... > OK, apology accepted. -- Russell Holden Computer Corporation of America Four Cambridge Center Cambridge, MA 02142