Harald Hanche-Olsen <hanche@...> writes:
> + Matt Kaufmann <kaufmann@...>:
> | I'm tempted to call quit with :recklessly-p t, because otherwise my
> | own read-eval-print loop prevents the quit. But it occurs to me that
> | if this were completely safe, then sbcl might have made t the default
> | for :recklessly-p. What sort of bad consequence might there be from
> | using :recklessly-p t for quit? Might there be some operating systems
> | on which this is safe and others where it's not (and if so, then when
> | is it safe)?
> I am having a hard time imagining any danger outside your own
> application. But inside it, the dangers will be the usual suspects:
> Output files closed without flushing buffers, network protocols
> interrupted, database connections dropped in the middle of a
> transaction, whatever. Only you as an application programmer can know
> whether these dangers are real or not, which is probably why the
> default is :recklessly-p nil.
Right, though the same concerns apply to all libraries as well -- not
just the main application.
> If you have your own repl that prevents exiting, maybe you should
> rewrite it, adding a catch that you can throw to in order to quit
This sounds like the correct thing to do, albeit I think a REPL that
prevents QUIT from passing out sounds a bit suspect. Does the control
flow look something like this?
(defun my-repl () (loop (my-rep)))
(defun my-toplevel ()
? I suspect it does, and if so, you should be able to rearrange it so
that the QUIT can unwind from it.
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."