我在脚本文件中使用ASDF load cl-ppcre。问题是,(progn (require :asdf) (require :cl-ppcre))在顶层是完全正确的,但是如果包装在handler-case中的相同代码,handler-case将捕获system-out-of-date条件,整个评估将停止,所需的包将不会被加载。我只是确认同样的问题也发生在REPL中。无论我试图加载哪个库,handler-case中都会出现相同的问题。以下是一次完整的会议:
; SLIME 2.27
CL-USER> (require :asdf)
NIL
CL-USER> (find-package :cl-ppcre)
NIL
CL-USER> (handler-case (require :cl-ppcre) (t (c) (format t "~a: ~a~%" (type-of c) c)))
SYSTEM-OUT-OF-DATE: system cl-ppcre is out of date
NIL
CL-USER> (find-package :cl-ppcre)
NIL
CL-USER> (require :cl-ppcre)
NIL
CL-USER> (find-package :cl-ppcre)
#<PACKAGE "CL-PPCRE">
CL-USER> (handler-case (require :cl-ppcre) (t (c) (format t "~a: ~a~%" (type-of c) c)))
NIL
CL-USER> (list (lisp-implementation-type) (lisp-implementation-version))
("SBCL" "2.2.4")
CL-USER> (asdf:asdf-version)
"3.3.1"
CL-USER> (directory "/home/pxie/common-lisp/*" :resolve-symlinks nil)
(#P"/home/pxie/common-lisp/alexandria/" #P"/home/pxie/common-lisp/cl-ppcre/")根据ASDF手册,我将我的库放在~/common-lisp directory中,库已经编译并保存在~/.cache/common-lisp directory中。
对ASDF所发生的事情有什么见解吗?
发布于 2022-05-22 15:42:08
如果您要求handler-case捕获任何已发出信号的条件,就像您所做的那样,它会这样做,不管条件是否是一个错误。你几乎从来都不想这么做。
特别是,如果您查看plan.lisp中的ASDF源,您会发现
;; NB: This is not an error, not a warning, but a normal expected condition,
;; to be to signaled by FIND-SYSTEM when it detects an out-of-date system,
;; *before* it tries to replace it with a new definition.
(define-condition system-out-of-date (condition)
...)https://stackoverflow.com/questions/72334900
复制相似问题