Search code examples
emacscommon-lispsbclslime

How can I exit a program running in the repl in common lisp?


when I run a function in the repl, the repl becomes a place to input user values.

For example:


(defun asking-questions ()
  (let ((firstname (prompt-read "What is the firstname of the contact?"))
    (email (prompt-read "What is their email?"))
    (company (prompt-read "What is the company name?"))

.... ))

(defun prompt-read (question)
  (format *query-io* "~a:  " question)
  (force-output *query-io*)
  (read-line *query-io*))

Sometimes, I want to 'cleanly' close the program mid-way through because I am experementing with the email input (for example.

My desired outcome is to press a set of keys that allow me to go back to the package>. How do I accomplish that?

I use emacs + SBCL.


Solution

  • If you are using Slime with emacs you can press C-c C-b to drop into the debugger where you can abort the program by choosing an appropriate restart.