Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!akgua!mcnc!decvax!harpo!ihnp4!zehntel!hplabs!sri-unix!RWK%SCH-GODZILLA@MIT-MC.ARPA From: RWK%SCH-GODZILLA@MIT-MC.ARPA Newsgroups: net.works Subject: WORKS Digest V4 #18 Message-ID: <12374@sri-arpa.UUCP> Date: Sun, 15-Apr-84 17:19:00 EST Article-I.D.: sri-arpa.12374 Posted: Sun Apr 15 17:19:00 1984 Date-Received: Mon, 23-Apr-84 01:39:37 EST Lines: 52 From: "Robert W. Kerns" Date: 16 Apr 84 21:17:26-EST (Mon) From: ihnp4!drutx!houxe!hogpc!houti!ariel!vax135!floyd!clyde! From: watmath!utzoo!utcsrgv!peterr @ Ucb-Vax Hippity hippity hop. Subject: Time for keyword parameters for prog. lang's (Lots of assemblers and things have always supported keyword arguments, especially in macros for some reason. VMS makes big use of it, both in languages and in commands). Still, the added typing, with increased chance of typos, *would* be a nuisance. Fortunately, the technology is with us to avoid this extra typing. A language-based editor can easily maintain a database of procedure parameters and present a procedure call template on demand. For example, if one types Lookup( then it could complete the statement, resulting in Lookup(name: _____, symIndex: ______) and position the cursor at the first field (type and parameter kind (pass by value, value-result, reference, etc.) information could also be presented). If anyone knows of a programming environment that supports such a scheme, I'd be grateful to hear about it. Ada and, I believe, Mesa support keyword parameters, but I don't know if the APSE or Cedar environments have procedure call templates... does anyone out there know? Zmacs (the editor on the Lisp machine), together with Zetalisp or Common Lisp, provide you with aids along a somewhat parallel line. While you're typing in the arguments to a function, you can type Control-Shift-A, and the argument list for the function will be displayed at the bottom of your screen. You still have to type in the keywords (or positional arguments), but you don't have to remember how to spell them. It even tells you the default values, and if multiple return values are declared, it tells you about those as well. But this doesn't address the issue of saving typing. I have had some experience with template-based tools, in an editing package I put together in EMACS for an experimental lisp-based languaged that was used in Macsyma at one time. I found there is a fundamental incompatibility between keyword arguments and templates. One of the most important points to keyword arguments that they are amorphous. You don't have to include them all, and you don't have to include them in any specific order. I found I had to do nearly as much work to DELETE extraneous keywords from the list as I would to type them in by hand. The big advantage of templates, either in positional or keyword syntaxes, is in the prompting they provide. Zmacs provides this quite handily. But it would be fairly easy, now that I think of it, to provide COMPLETION of keywords in Zmacs. I think this would come close to providing the best of both worlds.