如何关闭sbcl中的调试器 [英] how to turn off the debugger in sbcl

查看:178
本文介绍了如何关闭sbcl中的调试器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习普通的lisp,我一直在使用sbcl(希望这是一个不错的实现选择。)



来自ruby和irb发现自动移动到一个调试器的每一个错误有点烦人在这个时候。当我玩耍时,有没有办法临时关闭它。

解决方案

Common Lisp有一个变量 * debugger-hook * ,可以绑定/设置为一个函数。

  *(aref12310)

在SB-INT上调用的调试器:INVALID-ARRAY-INDEX-ERROR:
索引为(SIMPLE- ARRAY CHARACTER
(3)),应为非负数,< 3。

键入HELP进行调试器帮助,或(SB-EXT:QUIT)退出SBCL。

重新启动(可以通过数字或可能缩写的名称调用):
0:[ABORT]退出调试器,返回顶层。

(SB-INT:INVALID-ARRAY-INDEX-ERROR12310 3 NIL)
0] 0

*(defun debug-ignore )(declare(忽略h))(print c)(abort))

DEBUG-IGNORE
*(setf * debugger-hook *#'debug-ignore)

#< FUNCTION DEBUG-IGNORE>
*(aref12310)

#< SB-INT:INVALID-ARRAY-INDEX-ERROR {1002A661D1}>
*


I'm trying to learn common lisp currently and I've been using sbcl (I hope that's a decent implementation choice.)

Coming from ruby and irb I find the automatic moved to a debugger on every mistake a little annoying at this time. Is there a way to turn it off temporarily when I'm playing around.

解决方案

Common Lisp has a variable *debugger-hook*, which can be bound/set to a function.

* (aref "123" 10)

debugger invoked on a SB-INT:INVALID-ARRAY-INDEX-ERROR:
  Index 10 out of bounds for (SIMPLE-ARRAY CHARACTER
                              (3)), should be nonnegative and <3.

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.

(SB-INT:INVALID-ARRAY-INDEX-ERROR "123" 10 3 NIL)
0] 0

* (defun debug-ignore (c h) (declare (ignore h)) (print c) (abort))

DEBUG-IGNORE
* (setf *debugger-hook* #'debug-ignore)

#<FUNCTION DEBUG-IGNORE>
* (aref "123" 10)

#<SB-INT:INVALID-ARRAY-INDEX-ERROR {1002A661D1}>
* 

这篇关于如何关闭sbcl中的调试器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆