将Lisp-Stat加载至Allegro Common Lisp时遇sb-cltl2缺失错误求解决方案
在Allegro Common Lisp 10.1中加载Lisp-Stat解决"sb-cltl2"缺失的办法
sb-cltl2是SBCL专属的系统,用来提供CLTL2标准的扩展功能,但Allegro CL本身已经内置了这些CLTL2特性,只是没用到这个系统名。你可以通过以下几种方式解决:
方式一:创建sb-cltl2兼容层
- 在
~/quicklisp/local-projects/下新建sb-cltl2文件夹 - 文件夹里创建
sb-cltl2.asd文件,内容如下:(defsystem "sb-cltl2" :description "CLTL2 compatibility layer for Allegro CL" :components ((:file "sb-cltl2"))) - 再创建
sb-cltl2.lisp文件,内容:(in-package :cl) (export '(variable-information function-information declaration-information augment-environment define-declaration)) - 重启Allegro CL后,执行
(ql:quickload :sb-cltl2),之后再加载Lisp-Stat即可
- 在
方式二:修改Lisp-Stat的系统依赖
找到Lisp-Stat的.asd系统文件,把里面依赖中的"sb-cltl2"改成条件加载::depends-on (... #+sbcl "sb-cltl2" ...)这样Allegro CL加载时会自动跳过sb-cltl2的依赖,直接用内置的CLTL2功能
方式三:手动映射符号(临时解决)
如果不想折腾文件,加载Lisp-Stat前先在REPL里执行:(in-package :cl) (export '(variable-information function-information declaration-information augment-environment define-declaration)) (pushnew :sb-cltl2 *features*)再执行加载Lisp-Stat的命令,也能绕过依赖检查
内容的提问来源于stack exchange,提问作者John Watton
相关产品推荐
相关产品推荐

