xml - 如何正确使用带有 quicklisp(和 sbcl)的 cxml/klacks 库?
问题描述
概述
我正在尝试运行此代码的简化版本,它需要用于 XML 解析的cxml
和klacks
库。(具体代码是《The Art of Postgresql》一书的第47章。)由于我对(Common)Lisp/ASDF/Quicklisp知之甚少,所以不知道如何正确安装所需的cxml
/klacks
库。
系统
如果有问题,我SBCL 1.5.5.debian
在 Ubuntu 下使用(作为记录,我之前尝试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/
),还是仅从在线存储库中工作?(换句话说:我cl-xml
通过 apt-get 安装是否重要?)如果考虑到本地路径,那么为什么找不到
cxml/dom
andcxml/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)
解决方案
因为你可以加载其他系统,我假设你已经在你的系统上设置了 quicklisp。
quicklisp 上没有名为“klacks”的包。
您可以通过运行检查这一点:
(ql:system-apropos "klacks")
哪个输出:
#<SYSTEM cxml-klacks / cxml-20181018-git / quicklisp 2019-03-07>
#<SYSTEM cxml/klacks / cxml-20181018-git / quicklisp 2019-03-07>
#<SYSTEM fxml/klacks / fxml-20181210-git / quicklisp 2019-03-07>
所以你正在寻找的系统是cxml-klacks
加载它使用:
(ql:quickload "cxml-klacks")
加载很好。我的系统上的输出:
To load "cxml-klacks":
Load 1 ASDF system:
cxml-klacks
; Loading "cxml-klacks"
;;; Checking for wide character support... yes, using code points.
;;; Checking for wide character support... yes, using code points.
;;; Building Closure with CHARACTER RUNES
("cxml-klacks")
此外,cxml
在我的系统上加载正常,但我使用的是 Clozure CL,我不确定该错误对你来说是什么。尝试加载cxml-klacks
,看看是否适合您。
您也可以尝试 loading cxml/klacks
,这可能是您想要的包。
推荐阅读
- macos - 授予 XAMPP VM 访问主机系统上的服务的权限?
- ansible - ansible-playbook 尝试打印调试字符串但没有成功
- google-sheets - 仅将公式应用于 Google 表格上的可见单元格(使用过滤器)
- node.js - 如何将对话参考(字典)存储到 Azure DB 存储中
- node.js - MERN 堆栈中的 CSRF 实现
- java - 如何避免 .flatMap(x-> reactiveAction(x).thenReturn(x))
- regex - 正则表达式匹配除多个路径模式之外的所有内容
- reactjs - 如何使用私有路由配置 react-route?
- testing - 使用 -X 开关重新运行 SonarQube Scanner 以启用完整的调试日志记录
- python - pandas str.contains 匹配不使用正则表达式 boudry 的确切子字符串