Hello,
I would find it convient if slime included a function like the following:
(defun slime-repl-send (form) (slime-repl-send-string (slime-prin1-to-string form)))
As I work on emacs interfaces for various common lisp programs, I use this utility to send forms to the repl without having to write them as strings.
Thanks, John Foerch RetroJ on #emacs
* John J Foerch [2007-09-18 17:01+0200] writes:
Hello,
I would find it convient if slime included a function like the following:
(defun slime-repl-send (form) (slime-repl-send-string (slime-prin1-to-string form)))
As I work on emacs interfaces for various common lisp programs, I use this utility to send forms to the repl without having to write them as strings.
We could create a contrib for it if you have something more substantial than a single function.
Helmut.
Helmut Eller heller@common-lisp.net writes:
We could create a contrib for it if you have something more substantial than a single function.
Helmut.
Nope, this is all I need. It seems a natural enough extension given functions that are in slime now, like `slime-repl-send-string' and `slime-send'.
But let me ask this question. I'm writing an emacs/slime based front-end for a common lisp program I'm developing. The slime repl is considered to be part of the UI of this program. There are emacs commands to send forms to slime via the function I gave, but the user can also type forms into the repl directly. The code that programmatically uses the repl is easier to read and maintain if I write the forms as quoted sexps instead of strings. Or is there a different, better, preferred way to do what I am doing?
--John
* John J Foerch [2007-09-20 19:26+0200] writes:
Nope, this is all I need. It seems a natural enough extension given functions that are in slime now, like `slime-repl-send-string' and `slime-send'.
But let me ask this question. I'm writing an emacs/slime based front-end for a common lisp program I'm developing. The slime repl is considered to be part of the UI of this program. There are emacs commands to send forms to slime via the function I gave, but the user can also type forms into the repl directly. The code that programmatically uses the repl is easier to read and maintain if I write the forms as quoted sexps instead of strings. Or is there a different, better, preferred way to do what I am doing?
Sounds OK to me, since the Slime REPL is part of the UI.
But consider that slime-repl-send-string is a implementation detail, not some documented interface function. Don't blame us if we change it and break your code. Slime doesn't have a documented API and it would be a lot of work to create one. The function slime-eval-async is likely to stay forever, though. Use that if you need something stable.
Also keep in mind that Emacs sexps and CL sexps look very similar but aren't fully equivalent. The proposed slime-repl-send converts a Elisp sexp to a string and the string is converted to a CL sexp. The final result depends on the current CL reader settings. That may exactly be what you need in your application, but often it's not.
Helmut.
Helmut Eller heller@common-lisp.net writes:
Sounds OK to me, since the Slime REPL is part of the UI.
But consider that slime-repl-send-string is a implementation detail, not some documented interface function. Don't blame us if we change it and break your code. Slime doesn't have a documented API and it would be a lot of work to create one. The function slime-eval-async is likely to stay forever, though. Use that if you need something stable.
Also keep in mind that Emacs sexps and CL sexps look very similar but aren't fully equivalent. The proposed slime-repl-send converts a Elisp sexp to a string and the string is converted to a CL sexp. The final result depends on the current CL reader settings. That may exactly be what you need in your application, but often it's not.
Helmut.
Ah, thank you. I can use slime-eval-async, and nevermind about slime-repl-send.
--John