comp.lang.ada
 help / color / mirror / Atom feed
From: markb@sdcrdcf.UUCP (Mark Biggar)
Subject: Re: ForTran-Ada + flamette + question
Date: Wed, 21-May-86 11:41:25 EDT	[thread overview]
Date: Wed May 21 11:41:25 1986
Message-ID: <2811@sdcrdcf.UUCP> (raw)
In-Reply-To: 8605210805.AA20308@ucbvax.Berkeley.EDU

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

  reply	other threads:[~1986-05-21 15:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-05-21  6:06 ForTran-Ada + flamette + question larry
1986-05-21 15:41 ` Mark Biggar [this message]
1986-05-21 16:40 ` broman
1986-05-27 13:07   ` ForTran-Ada ... (really procedure variables) Vic Churchill
1986-05-28 19:30 ` ForTran-Ada + flamette + question David Lamb
     [not found] <175155@QZCOM>
1986-05-22  1:00 ` Jan_Michael_Rynning
  -- strict thread matches above, loose matches on Subject: below --
1986-05-28 15:54 richw
1986-05-30 12:46 ` Russ Holden
1986-05-28 16:56 richw
1986-05-30 16:28 ` Vincent P. Broman
1986-06-02 16:28   ` Jonathan P. Biggar
1986-06-03  5:11     ` Barry Margolin
1986-06-03 12:39     ` Russ Holden
1986-06-04 23:39   ` Bryce Bardin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox