sbcl 1.0.57.0을 사용 중이며 --eval
을 통해 프로그램을 시작하려고합니다. 일부 출력을 생성해야하지만, 잡히지 않은 오류가있는 경우 종료해야합니다. unwind-protect - 어떻게 작동합니까?
(sb-ext:exit)
으로
(unwind-protect (error 'simple-error)
(progn (FORMAT t "IAMREACHED~%") (sb-ext:exit)))
는 executet해야합니다.
하지만 그렇지 않습니다!
* (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 작동에 대한 나의 오해는 무엇입니까?
은 CCL에서 작동하지만 SBCL에서 같은 문제를 보여줍니다. – Lex
progn이 필요하지 않습니다. –
캐치 오류가 없습니다. SBCL 디버거가이를 잡았습니다. –