如何退出lispworks repl debugger,返回到最高级别,仅键入一个数字,例如sbcl



我当前正在使用lispworks,我想设置repl,以便我可以通过键入对应于 (abort) Return to top loop level 0的数字来退出调试器,就像使用sbcl相同的方式。

通常,使用lispworks键入 :c + [abort option number]

请参见使用Lispworks的微不足道示例:

CL-USER 1 > a
Error: The variable A is unbound.
  1 (continue) Try evaluating A again.
  2 Return the value of :A instead.
  3 Specify a value to use this time instead of evaluating A.
  4 Specify a value to set A to.
  5 (abort) Return to top loop level 0.
Type :b for backtrace or :c <option number> to proceed.
Type :bug-form "<subject>" for a bug report template or :? for other options.
CL-USER 2 : 1 > :c 5
CL-USER 3 >

使用SBCL时,只有数字就足够了:

* a
debugger invoked on a UNBOUND-VARIABLE in thread
#<THREAD "main thread" RUNNING {10012E0613}>:
  The variable A is unbound.
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE   ] Retry using A.
  1: [USE-VALUE  ] Use specified value.
  2: [STORE-VALUE] Set specified value and use it.
  3: [ABORT      ] Exit debugger, returning to top level.
(SB-INT:SIMPLE-EVAL-IN-LEXENV A #<NULL-LEXENV>)
0] 3
*

REPL DEBUGGER命令文档似乎没有列出这种可能性。

如果可能

基本上你不能。它也更加一致:

* a
debugger invoked on a UNBOUND-VARIABLE in thread
#<THREAD "main thread" RUNNING {10005004F3}>:
  The variable A is unbound.
    Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
    restarts (invokable by number or by possibly-abbreviated name):
      0: [CONTINUE   ] Retry using A.
      1: [USE-VALUE  ] Use specified value.
      2: [STORE-VALUE] Set specified value and use it.
      3: [ABORT      ] Exit debugger, returning to top level.
    (SB-INT:SIMPLE-EVAL-IN-LEXENV A #<NULL-LEXENV>)
    0] 4
    4
    0] 3
    * 

在上面的SBCL示例中,数字0 ... 3选择该调试器选项,所有其他数字都评估...这有点奇怪。

lispworks:调试器中的简单堕胎

在lispworks中,如果要使用abort重新启动,请使用:a

CL-USER 1 > a
Error: The variable A is unbound.
  1 (continue) Try evaluating A again.
  2 Return the value of :A instead.
  3 Specify a value to use this time instead of evaluating A.
  4 Specify a value to set A to.
  5 (abort) Return to level 0.
  6 Return to top-level loop.
  7 Return from multiprocessing.
Type :b for backtrace or :c <option number> to proceed.
Type :bug-form "<subject>" for a bug report template or :? for other options.
CL-USER 2 : 1 > :a
CL-USER 3 > 

在LISPWorks环境中,还有 meta-shift-a 键盘命令,可以在调试器中流产。此外,重新启动可在菜单和右键单击上下文菜单中可用。另外,人们可以在听众/调试器的图标栏中使用中止图标/...

优势:您不必记住重新启动的数量,因为这可能从错误到错误都不同。

当错误函数生成错误函数时,您在lispworks的rept中看到的内容,如Lispworks实现。要更改选项的处理方式,您将不得不修改该功能,这是您没有文档的内容,因为它以特定方式与Lispworks的repl进行了交互。因此,简而言之,您不能。(顺便说一句,c'in:c代表"继续"。(

最新更新