Search code examples
lispcommon-lispclisppathname

LISP MAKE-PATHNAME: Illegal :DIRECTORY argument


I download Semantic Network Processor project: http://digital.cs.usu.edu/~vkulyukin/vkweb/software/snp/snp.html

and following it's read me, By using CLISP interpreter I change the directory to the folder, and do the following:

[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

can anybody tells me what's wrong or how I can fix it in order to make the project run?


Solution

  • In snp-loader.lisp, instead of directory-namestring, you need to call pathname-directory:

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

    But then another problem occurs later, when defining a method for expectations-on-token. In c-snp-with-vars.lisp, the docstring is malformed, which triggers an error. Join both strings:

    (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)))
    

    Reload the snp-loader.lisp file, and retry (snp-load-everything). It should load properly.

    Edit. I contacted the original author; the latest version of the code is now hosted on GitHub at https://github.com/VKEDCO/AI/tree/master/NL/SNP.