From: Paul Dourish
Subject: Re: LISP read-eval-print loop
Date: 
Message-ID: <1991Sep12.102946.28323@parc.xerox.com>
In article <······················@CSD-NewsHost.Stanford.EDU>, ···@Neon.Stanford.EDU (Patrick Cheng S Teo) writes:
> I need the LISP program to be interpreted, i.e. there should be an image
> of the LISP interpreter (which is forked from the C program).  I would
> like to give the user the ability to use the LISP interpreter while at the
> same time, the C program can preempt the user and send commands to the LISP
> window itself.

One way to do this that doesn't involve messing with the Lisp at all
is to write a simple multiplexor program for your two input streams.

    - run the Lisp interpreter on a pseudo-terminal
    - have the multiplexor take two input streams - one from the
      socket and one from the user's terminal - and merge them into a
      single stream into the Lisp interpreter

You can now send input from either the terminal or from the other
process. The multiplexor can be configured to take output from the
Lisp and direct it appropriately.

I've used this approach for other (non-Lisp-related) applications, and
it's worked reasonably well.

                                                  -- Paul.