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.2 required=5.0 tests=BAYES_00,FROM_DOMAIN_NOVOWEL, INVALID_DATE,MSGID_SHORT,REPLYTO_WITHOUT_TO_CC 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!harvard!caip!lll-crg!lll-lcc!pyramid!hplabs!sdcrdcf!markb From: markb@sdcrdcf.UUCP (Mark Biggar) Newsgroups: net.lang.ada Subject: Re: ForTran-Ada + flamette + question Message-ID: <2811@sdcrdcf.UUCP> Date: Wed, 21-May-86 11:41:25 EDT Article-I.D.: sdcrdcf.2811 Posted: Wed May 21 11:41:25 1986 Date-Received: Sat, 24-May-86 02:54:17 EDT References: <8605210805.AA20308@ucbvax.Berkeley.EDU> Reply-To: markb@sdcrdcf.UUCP (Mark Biggar) Organization: System Development Corporation R&D, Santa Monica List-Id: In article <8605210805.AA20308@ucbvax.Berkeley.EDU> larry@JPL-VLSI.ARPA writes: >Anyone have an idea how to do run-time binding of keys to commands in Ada? This problem has a simple solution. There are two types of function in something like EMACS that you want to be able to bind to a key (or key sequence): built-in functions and user-defined functions (usually written in a lisp like language). Now if you assign to each function an id code (e.g. negative numbers for built-in functions and positive numbers for user-defined) then bind the key sequence to the id code. To interpret the key sequence just look at the id code, if it denotes a built-in you select the code for the built-in using a humongous case statement; otherwise pass the id code for the user-defined function off to the interpreter. Note that the same id codes for the built-in functions can be used in the data structures that are used to build the user-defined functions (you have the same problem with binding built-in functions into the user-defined functions as you do with binding them to key sequences). Mark Biggar {allegra,burdvax,cbosgd,hplabs,ihnp4,akgua,sdcsvax}!sdcrdcf!markb