[slime-devel] Sending values to the repl

Daniel White daniel at whitehouse.id.au
Thu Sep 3 04:07:55 UTC 2009


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?

Secondly, the problem is that SLIME-DISPATCH-EVENT for an :EMACS-REX
event returns the result of (SLIME-RECOMPUTE-MODELINES T), being:

[nil 0 0 100000 nil slime-update-all-modelines nil idle]

EVAL-IN-EMACS tries to read this and fails horribly throwing up the
following error:

error while parsing arguments to DESTRUCTURING-BIND:
  invalid number of elements in
    (SWANK-IO-PACKAGE::[NIL 0 0 100000 NIL
     SWANK-IO-PACKAGE::SLIME-UPDATE-ALL-MODELINES NIL
     SWANK-IO-PACKAGE::IDLE])
  to satisfy lambda list
    (SWANK::VALUE):
  exactly 1 expected, but 8 found
   [Condition of type SB-KERNEL::ARG-COUNT-ERROR]

As far as I can see, the solution is to have SLIME-REPL-SEND-STRING
return T since there doesn't seem to be anything relying on this
current behaviour.

I've attached a patch in the case that this is indeed a sane solution.

-- 
Daniel White
-------------- next part --------------
A non-text attachment was scrubbed...
Name: repl.patch
Type: text/x-patch
Size: 655 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/slime-devel/attachments/20090903/a0b84565/attachment.bin>


More information about the slime-devel mailing list