Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 Apollo 11/21/85; site apollo.uucp Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!wanginst!apollo!alan From: alan@apollo.uucp (Alan Lehotsky) Newsgroups: net.arch Subject: Re: pointers to freshly minted func Message-ID: <2c962626.7011@apollo.uucp> Date: Wed, 19-Mar-86 09:27:33 EST Article-I.D.: apollo.2c962626.7011 Posted: Wed Mar 19 09:27:33 1986 Date-Received: Sat, 22-Mar-86 03:19:08 EST References: <2277@phri.UUCP> <5600043@uiucdcsb> <798@ttrdc.UUCP> Reply-To: alan@apollo.UUCP (Alan Lehotsky) Organization: Apollo Computer Inc., Chelmsford MA Lines: 25 Summary: Regarding how SPICE on CDC would dynamically create procedures and then execute them. This is a classic FORTRAN trick and is handled by the fact that syntactically, the only difference between an array-reference and a subroutine or function call is that the array must have been dimensioned in a DIMENSION statement or a type-statement(among other places). So, if your compiler handles "named-common" by giving it a "global" name you can do: SUBROUTINE dummy COMMON /dynamic/ I(1000) C C "Compile" code into the array "I" (including correct entry-exit C sequences and parameter-passing conventions C ...... END SUBROUTINE hacker CALL dynamic(1,2,3) END This used to work on IBM-360s. This trick won't work on APOLLO-DOMAIN, VAX/VMS or (I think) most UNIX systems.