2

Is there a cross-implementation (at minimum SBCL, CCL, Lispworks and CLISP), cross-platform (Linux/Windows/OS X) way of capturing keyboard interrupts in Common Lisp? Or more specifically, to let a keyboard interrupt through?

I've got this code snippet in a file

...
(handler-case
    ...
  ((not simple-error) () (error! +400+ ready)))
...

whose purpose is to handle errors, but let the user interrupt the program with a keyboard interrupt (which in SBCL on Linux manifests as a simple-error). However, this doesn't seem to work in CCL (where that error clause seems to trigger even when the main code doesn't throw an error).

What's the right approach in this situation?

Inaimathi
  • 13,853
  • 9
  • 49
  • 93
  • 2
    Take a look at this: http://stackoverflow.com/questions/9950680/unix-signal-handling-in-common-lisp – Linuxios Jan 17 '14 at 20:49
  • It might be helpful if you could limit your question by specifying which operating systems and implementations you are talking about. Remember that Common Lisp is an old language and has some implementations which on some operating systems which are probably irrelevant. – verdammelt Jan 20 '14 at 21:05
  • @verdammelt - Point taken, and question updated. – Inaimathi Jan 21 '14 at 17:53

0 Answers0