Hello,
While trying to get slime to tell the repl to evaluate some common lisp code, I had tried to use the emacs form:
(slime-eval '(format t "ping ~d" 12) ":cl-user")
but, when I use this, sldb pops-up, with a message about: Error in KERNEL:%COERCE-TO-FUNCTION: the function SWANK-IO-PACKAGE::FORMAT is undefined.
So, I am just wondering why the package named SWANK-IO-PACKAGE is being used, as the package in which the REPL will evaluate the slime-eval'd FORM - instead of slime-eval using the :cl-user package, which was mentioned, also, in the call to slime-eval.
Thank you
-- Sean
Hi Sean,
Sean Champ schamp@commonwerx.org writes:
While trying to get slime to tell the repl to evaluate some common lisp code, I had tried to use the emacs form:
(slime-eval '(format t "ping ~d" 12) ":cl-user")
You could try instead: (slime-interactive-eval "(format t "ping ~d" 12)") which is like using `C-c :'
`slime-eval' is a lower-level function for writing Elisp programs with. These programs typically don't contain inline Common Lisp code, but just call external functions defined in some common lisp package (e.g. SWANK). For this usage the SWANK-IO-PACKAGE is okay.
but, when I use this, sldb pops-up, with a message about: Error in KERNEL:%COERCE-TO-FUNCTION: the function SWANK-IO-PACKAGE::FORMAT is undefined.
So, I am just wondering why the package named SWANK-IO-PACKAGE is being used, as the package in which the REPL will evaluate the slime-eval'd FORM - instead of slime-eval using the :cl-user package, which was mentioned, also, in the call to slime-eval.
What really happens is that Emacs prints its request-sexp as a string and then the Lisp side starts by READing that in the SWANK-IO-PACKAGE. Having decoded it and determined that it's an RPC request it will end up using the specified package (CL-USER in this example) for the actual EVAL.
Currently the SLIME protocol is overly sensitive to e.g. READ errors in slime-eval arguments.
Cheers, Luke