私は sbcl 1.0.57.0 を使用しており--eval
、何らかの出力を生成するプログラムを開始したいのですが、キャッチされないエラーがある場合は終了します。
これを達成する最も簡単な方法は、unwind-protect を使用することだと考えました。
(unwind-protect (error 'simple-error)
(progn (FORMAT t "IAMREACHED~%") (sb-ext:exit)))
(sb-ext:exit)
キャッチされていないエラーがある場合に備えて実行する必要があります。
しかし、そうではありません!
* (unwind-protect (error 'simple-error)
(progn (FORMAT t "IAMREACHED~%") (sb-ext:exit)))
debugger invoked on a SIMPLE-ERROR in thread
#<THREAD "main thread" RUNNING {1002979193}>:
(A SIMPLE-ERROR was caught when trying to print *DEBUG-CONDITION* when entering
the debugger. Printing was aborted and the SIMPLE-ERROR was stored in
SB-DEBUG::*NESTED-DEBUG-CONDITION*.)
Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.
(#:EVAL-THUNK)
0] 0
IAMREACHED
unwind-protect の仕組みについての私の誤解は何ですか?