跳過內容

除錯

取自維基百科,開放給開放世界的開源書籍

解析錯誤

[編輯 | 編輯原始碼]

解析錯誤尤其難以發現和修復。典型的解析錯誤看起來如下

 ? (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"
華夏公益教科書