[pro] How to interact with a running lisp instance?

Zach Beane xach at xach.com
Fri Dec 17 18:20:15 UTC 2010


Steve Morin <steve.morin at gmail.com> writes:

> How to interact with a running lisp instance?  I have been trying to figure
> this out.  I know this is being done with slime.  Does any one have any good
> pointer on this.  I am thinking of writing a web application and would like to
> be able to update it on the fly for updates and bug fixes.

There are a lot of different ways. I use GNU screen
<http://www.gnu.org/software/screen/> to detach/reattach from
interactive sessions running Emacs and slime attached to the Lisp
webserver running http://wigflip.com/.

There's nothing magical about slime, though, or even really about the
built-in repl of your implementation. Any way you can get data to the
system can be used to create objects you can evaluate with EVAL.

For example, you could have a HTTP handler that accepts POST requests
and takes a parameter as Lisp code to read with e.g. READ-FROM-STRING,
evaluate with EVAL and return the result with e.g. PRINT-TO-STRING.

You wouldn't do that without thinking about the safety implications, of
course...

Zach




More information about the pro mailing list