[slime-devel] non-interactive interaction with repl

I see how I can non-interactively feed the REPL, by using `slime-repl-eval-string' -- e.g. -- (slime-repl-eval-string "*package*") However, I don't see how to get the back into Emacs in a straightforward way. Whereas the above command prints the current package in the REPL buffer, I desire a command that returns the current package to Emacs. (slime-eval (+ 1 2)) returns 3. (slime-eval '*package*) triggers SLDB with the error The variable SWANK-IO-PACKAGE::*PACKAGE* is unbound. [Condition of type UNBOUND-VARIABLE]

Evaluation is done in the swank-io package, so what you really want is (slime-eval (list 'swank:eval-and-grab-output (format "%s" '*package*))), where swank:eval-and-grab-output does symbol reading in the current slime buffer for you. Vladimir On 6/19/07, Joe Corneli <jcorneli@planetmath.org> wrote:
I see how I can non-interactively feed the REPL, by using `slime-repl-eval-string' -- e.g. --
(slime-repl-eval-string "*package*")
However, I don't see how to get the back into Emacs in a straightforward way. Whereas the above command prints the current package in the REPL buffer, I desire a command that returns the current package to Emacs.
(slime-eval (+ 1 2))
returns 3.
(slime-eval '*package*)
triggers SLDB with the error
The variable SWANK-IO-PACKAGE::*PACKAGE* is unbound. [Condition of type UNBOUND-VARIABLE] _______________________________________________ slime-devel site list slime-devel@common-lisp.net http://common-lisp.net/mailman/listinfo/slime-devel

Thank you for the help. Can perhaps you explain why there is a `list' here? (slime-eval (list 'swank:eval-and-grab-output (format "%s" '*package*))) as opposed to (slime-eval (swank:eval-and-grab-output (format "%s" '*package*))) Perhaps that would help me understand what I find to be an even more perplexing question (from a separate thread)! http://common-lisp.net/pipermail/slime-devel/2007-June/006290.html
participants (2)
-
Joe Corneli
-
Vladimir Sedach