跳过内容

调试

取自维基百科,开放给开放世界的开源书籍

解析错误

[编辑 | 编辑源代码]

解析错误尤其难以发现和修复。典型的解析错误看起来如下

 ? (libload "main")
 *** read : end of file
 Debug toplevel [y/N] ?

你可以通过回答“y”并打印出fname来缩小错误范围

 ? (libload "main")
 *** read : end of file
 Debug toplevel [y/N] ?y
 ** in:  (load fname)
 ** from: (prog1 (load fname) (let ((mtime (alist-get (quote m ...
 ** from: (when (libload.check rname (htable)) (when (not (lus ...
 ** from: (let* ((fname (libload.search s)) (rname (or (relati ...
 ** from: (libload "state-cost")
 ** from: (load fname)
 [Debug]
 ? fname
 = "/home/mkg/projects/physlearn/state-cost.lsh"
华夏公益教科书