LISP MAKE-PATHNAME : Illegal :DIRECTORY argument

标签 lisp common-lisp clisp pathname

我下载语义网络处理器项目: http://digital.cs.usu.edu/~vkulyukin/vkweb/software/snp/snp.html

接着是读我, 通过使用 CLISP 解释器,我将目录更改为文件夹, 并执行以下操作:

[3]> (load "snp-loader.lisp")
;; Loading file snp-loader.lisp ...
;; Loaded file snp-loader.lisp
T

[4]> (in-package "USER")

<PACKAGE COMMON-LISP-USER>

[5]> (snp-load-everything)

**- MAKE-PATHNAME: Illegal :DIRECTORY argument "D:\\snp-stable\\"**

The following restarts are available:
ABORT          :R1      Abort main loop

谁能告诉我出了什么问题,或者我该如何解决才能使项目运行?

最佳答案

snp-loader.lisp中,您需要调用pathname-directory,而不是directory-namestring:

(defparameter parm-snp-load-dir 
  (pathname-directory *load-truename*))

但后来又出现了另一个问题,当为 expectations-on-token 定义方法时。在 c-snp-with-vars.lisp 中,文档字符串格式错误,这会触发错误。连接两个字符串:

(defmethod expectations-on-token ((this-snp c-snp-with-vars) (tok t))
  "Overloaded expectations-on-token to process variables and tests.
Get all expectations waiting for the token tok."
  `(,@(find-static-expectations this-snp tok)
       ,@(find-dynamic-expectations this-snp tok)))

重新加载 snp-loader.lisp 文件,然后重试 (snp-load-everything)。它应该正确加载。

编辑。我联系了原作者;最新版本的代码现在托管在 GitHub 上 https://github.com/VKEDCO/AI/tree/master/NL/SNP .

关于LISP MAKE-PATHNAME : Illegal :DIRECTORY argument,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47248544/

相关文章:

emacs - 粘液连接不工作

lisp - 在 lisp 中排序混合数据类型列表

functional-programming - Common Lisp - 模式匹配

scheme - 在 if 语句中使用 Let

clojure - Lisp-1 和 Lisp-2 有什么区别?

file - 用普通的 lisp 读取文件

lisp - 普通 lisp 中的类型安全和参数安全除法

common-lisp - Quicklisp 无法为 Hunchentoot 安装 LIBSSL

functional-programming - "Unable to resolve symbol"错误

tree - Lisp 抛硬币正面序列