[slime-devel] Evaluate forms from within Lisp buffers and displaying the result in the REPL
Rainer Joswig
joswig at lisp.de
Tue Apr 17 23:35:07 UTC 2007
Hi,
I'm a bit used to the behavior of MCL when it comes
to Lisp buffers and listeners. Maybe SLIME developers
know how to achieve a similar behavior or would like
to provide something similar.
MCL allowed multiple Lisp text editor windows and listener windows.
If there are multiple listeners one is the front most.
If the cursor is behind a Lisp form in a Lisp editor window,
one can press Enter (or control-return)
and the form will be enqueued into the REPL of the
front most listener. Doing this in a listener, the form will
be displayed at the prompt and enqueued in the listener's REPL.
Pressing Enter only has the effect that the form and the result
is shown in the listener. In the Editor window, nothing
happens (no cursor moved, no character entered, no
window focus changed).
The listener REPL gets the forms from its queue and displays
the form and the result at the end of the current buffer.
This way you get interaction histories in the listener.
Currently SLIME lets me evaluate a form in a text buffer and
the form gets printed into the listener and the result gets
printed in the mini-buffer. I can see then in the listener
the history of evaluated forms, but not the history of results.
Additionally the form will be printed with additional characters
before and after.
SLIME displays several forms evaluated from a text buffer in the REPL like this:
;;;; (+ 1 2) ...
;;;; (+ 1 2) ...
;;;; (+ 1 2) ...
The normal REPL interaction display would be like:
CL-USER> (+ 1 2)
3
CL-USER> (+ 1 2)
3
CL-USER> (+ 1 2)
3
Both ways look different. Why not use the latter for both interactions?
Useful is then also a command to rotate between the various listeners (next, previous)
and Lisp buffers (next, previous).
Advantages I see for MCL:
* With MCL you get the same REPL listener display if you evaluate forms from
the Lisp editor buffer (via RETURN) or if you use the REPL in the listener.
* Using the enter key (vs. Return) to evaluate code in the editor gets
rid of one complex keystroke.
* One gets reusable interaction histories in the listener where form and result
are displayed together.
Is SLIME already providing something similar? Would others find this way of interaction
between Lisp buffers and a REPL buffer useful?
Regards,
Rainer Joswig
--
http://lispm.dyndns.org
More information about the slime-devel
mailing list