[slime-devel] Re: Evaluate forms from within Lisp buffers and displaying the result in the REPL

Tobias C. Rittweiler tcr at freebits.de
Thu Apr 26 15:02:54 UTC 2007


"Bill Clementson" <billclem at gmail.com> writes:

> [...] As I see it, there may be 3 different types of "new" repl's that
> one could want to have [...]:
>
> #1: You want to "play around" with some ideas but don't want to "muck
> up" your existing lisp environment and repl. In that case, you
> probably want to start up a new lisp instance and test things in a
> completely independent repl. When I do "M-x slime" multiple times (and
> say "n" to the "Create an additional *inferior-lisp*?" prompt), that
> is exactly what I get - multiple lisp instances with a separate repl
> for each one.

I think you meant pressing `y' rather than `n' on the "Create an
additional *inferior-lisp*?" prompt, as `n' is more or less (maybe even
exactly) tantamount to ,restart-inferior-lisp on the REPL.


> #2: You want to have multiple repl's on the same lisp instance (with
> each repl sharing the repl history and */**/***/etc values). [...]
>
> (defun slime-new-repl ()
>  "Create additional REPL for the current Lisp connection."
>  (interactive)
>  (if (slime-current-connection)
>      (let ((port (slime-connection-port (slime-connection))))
> 	(slime-eval `(swank::create-server :port ,port))
> 	(slime-connect slime-lisp-host port))
>      (error "Not connected")))
>
> and just do "M-x slime-new-repl" whenever you wanted a new repl. [...]
>
> #3: You want to have multiple repl's on the same lisp instance (with
> each repl having it's own repl history and */**/***/etc values). I
> thought that it was possible to do this at one time with SLIME;
> however, I just had a play and I don't think there is any way that you
> can currently do this in SLIME.

It may be possible to do it similiarly to your above function, but
making CL:*, CL:**, CL:*** &c thread-local.

  -T.





More information about the slime-devel mailing list