[slime-devel] Sending values to the repl

Tobias C. Rittweiler tcr at freebits.de
Thu Sep 3 06:38:41 UTC 2009


Daniel White <daniel at whitehouse.id.au> writes:

> I want to send values to the repl from the Lisp image.
>
> (swank::eval-in-emacs '(slime-repl-send-string "(+ 1 1)"))
>
> Firstly, is there a simpler way to approach this?

If you want to write stuff as output to the REPL buffer, use

  (defun repl-stream ()
    (swank::connection.user-output (or swank::*emacs-connection*
                                       (swank::default-connection))))

  (format (repl-stream) "Foobar~%")

If you want to send something as a result (which will turn into a
presentation if you use the slime-presentations contrib), use

  (defun send-as-repl-result (&rest objects)
    (funcall *send-repl-results-function* objects))

  -T.





More information about the slime-devel mailing list