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.6 required=5.0 tests=BAYES_05,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!nadc.arpa!prindle From: prindle@NADC.ARPA Newsgroups: net.lang.ada Subject: re: Procedures as arguments Message-ID: <8510222207.AA11074@UCB-VAX> Date: Tue, 22-Oct-85 16:39:05 EDT Article-I.D.: UCB-VAX.8510222207.AA11074 Posted: Tue Oct 22 16:39:05 1985 Date-Received: Thu, 24-Oct-85 00:06:08 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: This subject was discussed at quite some length over a year ago on this list (you might hunt down the archives). The gist of the discussion was that it could be done by making the procedure that is to call another procedure generic, with an instantiation parameter to define the procedure to be called. The top level calling procedure then instantiates the generic once for each different procedure that the generic must call, then calls the proper instantiated procedure at the proper time. My opposition to this solution was that if multiple procedures were to be called, multiple copies of the generic differing only in the procedure called from within itself would be produced. The rebuttal to this argument was that any reasonable compiler would handle such instantiations by simply passing a hidden argument to the middle procedure which was the address of the final procedure to be called (which, of course, is what everyone wanted to do in the first place, but couldn't figure out how to). Now the only problem is "where is this *reasonable* compiler?". The ALS compiler openly admits that there is no code sharing between instantiations of the same generic; sort of leavs the question open, doesn't it! Perhaps others can tell this list how their "favorite" Ada compiler handles multiple instantiations of a generic where the only generic parameters are functions/procedures to be called (i.e. is a hidden parameter passed for each function, is the code fully duplicated, or perhaps something even more exciting done?). Frank Prindle Prindle@NADC