You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

将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兼容层

    1. 在~/quicklisp/local-projects/下新建sb-cltl2文件夹
    2. 文件夹里创建sb-cltl2.asd文件,内容如下:
      (defsystem "sb-cltl2"
        :description "CLTL2 compatibility layer for Allegro CL"
        :components ((:file "sb-cltl2")))
      
    3. 再创建sb-cltl2.lisp文件,内容:
      (in-package :cl)
      (export '(variable-information function-information declaration-information
                augment-environment define-declaration))
      
    4. 重启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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 03:48:16