【发布时间】:2020-11-03 09:31:15
【问题描述】:
概述
我正在尝试运行this code 的简化版本,它需要cxml 和klacks 库来进行XML 解析。 (具体代码为"The Art of Postgresql"本书第47章。)
由于我对(Common) Lisp/ASDF/Quicklisp知之甚少,所以不知道如何正确安装所需的cxml/klacks库。
系统
万一这很重要,我在 Ubuntu 下使用 SBCL 1.5.5.debian(作为记录,我之前尝试过 clisp,但我发现它带有一个非常过时的 ASDF 版本。)
到目前为止我已完成的步骤
在 bash 中:
sudo apt-get install cl-cxml
(确实 /usr/share/common-lisp/source/cxml/ 和 /usr/share/common-lisp/source/cxml/klacks/ 现在出现在我的系统上。)
在 sbcl REPL 中:
(ql:quickload :cxml)
结果:一条很长的错误消息,其要点似乎是Component "cxml/dom" not found。 (尽管/usr/share/common-lisp/source/cxml/dom 确实存在,但我不确定它是否重要。)请参阅最后的完整错误消息。
(ql:quickload :klacks)
结果:另一个长错误,其要点是System "klacks" not found(即使该目录再次出现在系统上)。
备注
将qucikload 用于其他库作品,例如:
(ql:quickload :postmodern)
(ql:quickload :zip)
(ql:quickload :yason)
问题
简而言之:在上述系统上安装cxml 和klacks 的正确方法是什么?
除了这个具体问题的解决方案,我想更好地了解发生了什么,特别是:
-
是否可以使用
quicklisp安装所有依赖项,或者是否有一些支持它而一些不支持? (在这种情况下,cxml是不支持quicklisp的依赖项吗?我怎么知道哪些包支持它?) -
quciklisp是否查看本地安装(即/usr/share/common-lisp/source/cxml/),还是仅从在线存储库中工作? (换句话说:我通过 apt-get 安装cl-xml是否重要?) -
如果考虑到本地路径,那为什么找不到
cxml/dom和cxml/klacks? -
既然
klacks是cxml的子包,那我需要单独导入吗? 通过浏览提到的源代码,尤其是package.lisp 和pubnames.asd,我没有看到它显式导入。它仍然在代码中使用,例如here。所以我想需要的是显式导入cxml,然后所有子包(包括klacks)也被导入,自动加上正确的命名空间前缀?
详细的错误信息
* (ql:quickload :cxml)
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
To load "cxml":
Load 1 ASDF system:
cxml
; Loading "cxml"
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
.
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
;;; Building Closure with CHARACTER RUNES
To load "cxml/dom":
Load 3 ASDF systems:
closure-common puri trivial-gray-streams
Install 1 Quicklisp release:
cxml
; Loading "cxml/dom"
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
yes, using code points.
.
debugger invoked on a ASDF/FIND-COMPONENT:MISSING-COMPONENT in thread
#<THREAD "main thread" RUNNING {10005504C3}>:
Component "cxml/dom" not found
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [RETRY ] Retry ASDF operation.
1: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
configuration.
2: Retry ASDF operation.
3: Retry ASDF operation after resetting the
configuration.
4: [ABORT ] Give up on "cxml/dom"
5: Give up on "cxml"
6: Exit debugger, returning to top level.
((:METHOD ASDF/OPERATE:OPERATE (SYMBOL T)) ASDF/LISP-ACTION:LOAD-OP "cxml/dom" :VERBOSE NIL) [fast-method]
error finding frame source: Bogus form-number: the source file has probably
changed too much to cope with.
source: NIL
0]
* (ql:quickload :klacks)
debugger invoked on a QUICKLISP-CLIENT:SYSTEM-NOT-FOUND in thread
#<THREAD "main thread" RUNNING {10005504C3}>:
System "klacks" not found
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-abbreviated name):
0: [CONTINUE] Try again
1: [ABORT ] Give up on "klacks"
2: Exit debugger, returning to top level.
((LABELS QUICKLISP-CLIENT::RECURSE :IN QUICKLISP-CLIENT::COMPUTE-LOAD-STRATEGY) "klacks")
source: (CERROR "Try again" 'SYSTEM-NOT-FOUND :NAME NAME)
【问题讨论】:
-
我强烈怀疑您的 SBCL 太旧了,您应该尝试使用当前的。
标签: xml common-lisp sbcl quicklisp asdf