1

我正在学习 ASDF,但在加载定义的系统时遇到了奇怪的问题。这里有一些信息。我用单行内容定义了一个名为“hello.asd”的.asd 文件:

(asdf:defsystem :hellosystem)

我将此文件放入名为“ /tmp/pkg ”的目录中。之后,我运行 SBCL 并尝试加载它。这是输出:

This is SBCL 1.1.12, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.
* (asdf:asdf-version)

"3.0.2"
* (push #P"/tmp/pkg/" asdf:*central-registry*)

(#P"/tmp/pkg/" #P"/Users/wuli2/quicklisp/quicklisp/")
* (asdf:load-system :hellosystem)

debugger invoked on a ASDF/FIND-SYSTEM:MISSING-COMPONENT:
  Component :HELLOSYSTEM 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: [ABORT] Exit debugger, returning to top level.

((:METHOD ASDF/OPERATE:OPERATE (SYMBOL T)) ASDF/LISP-ACTION:LOAD-OP :HELLOSYSTEM) [fast-method]
0] 0

* (asdf:load-system :hello)

debugger invoked on a ASDF/FIND-SYSTEM:MISSING-COMPONENT:
  Component :HELLO 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: [ABORT] Exit debugger, returning to top level.

((:METHOD ASDF/OPERATE:OPERATE (SYMBOL T)) ASDF/LISP-ACTION:LOAD-OP :HELLO) [fast-method]
0] 0

* (asdf:load-system :hellosystem)

T
* 

请注意,我第一次尝试加载 system :hellosystem时失败了。所以我加载系统:你好,我猜测它可能需要一个文件名,它又失败了。当我偶尔再次运行 load system :hellosystem时发生了奇怪的事情,它起作用了。

所以我做了另一个测试,改变文件名让它和系统名一样。然后运行 ​​asdf:load-system,它直接工作了。

这让我很困惑,我在 ASDF 手册中找不到任何线索表明这两个名称应该相同?

有人可以给我一些见解吗?

谢谢,

4

1 回答 1

3

我发现了这条线索:“注意系统的名称被指定为字符串或符号,通常是关键字。如果是符号(包括关键字),则取其名称并小写。名称必须是合适的值:name initarg 在要找到系统的任何文件系统中生成路径名。 "

http://common-lisp.net/project/asdf/asdf/Using-ASDF.html

消息是(asdf:defsystem <symbol> ...)表单应该驻留在一个名为<lowercased-symbol>.asd. 如果您使用字符串命名系统,则文件名应使用该字符串。

于 2013-11-15T05:40:23.573 回答