This is a very simple demonstration of how to use a Tcl script as an
interface to a Lisp process (running Lucid Common Lisp).  Essentially,
Lisp (in function "init-interface") starts a process that executes the
Wish script "test.tcl".  The interaction is completely synchronous--
Lisp and Wish take turns waiting for the other.  The wish script waits
for user input, meanwhile Lisp is waiting to hear from Wish.  When the
user does something Lisp should know about, the wish script tells Lisp
what happened.  Wish then waits for Lisp to tell it to go on.

The Wish script displays a small window with a number of buttons.
When you click on a button, the wish script sends a code to the
awaiting Lisp function.  It looks up the code sent in a hash table and
calls a function that has been registered with that code.

The demonstration includes

  - calling a Tcl procedure from Lisp (with and without arguments)
  - reconfiguring a widget from within Lisp
  - defining and executing a Tcl procedure dynamically from Wish

------------------

Requirements:

  Tcl ("wish") version 6.0.

  Lucid Common Lisp, version 4.0 or so.  Again, nothing inherently
  fancy (run-program), but I know it works here.

------------------- 

This tar file contains the following five files:

  README			(this file)
  test.tcl
  lisp2wish.lisp
  test.lisp
  readlns.awk

In Lisp, because of the hash table initialization, you must load
"lisp2wish.lisp" before "test.lisp".  You don't have to do anything
with "readlns.awk"-- the Wish script does that for you.  Lastly, you
should change the top line in test.tcl to indicate where your copy of
"wish" (the interpreter) resides.


------------------

To use:

Make sure your environment can run the wish interpreter.

get into lisp

> (load "lisp2wish.lisp")
> (load "test.lisp")
> (main)

and away you go!

------------------

Good Luck!  Please write with comments, suggestions or questions.  My
system is more extensive than this (especially with respect to
exchanging info between Wish and Lisp), but this gives the basic idea.
I don't see any reason you couldn't substitute your own interpreter
for "wish" if you've built new Tcl commands through Tk, then Lisp
could use them as well.

Jonathan
kaye@linc.cis.upenn.edu
February 27, 1992
