Common Lisp: unable to load a file into the Lisp interpreter

时间:2015-09-01 21:46:15

标签: lisp common-lisp

Lisp newbie here.

I created a function and put it into this file: compress.lisp

Now I want to load it into the Lisp interpreter that I am using, GCL-2.6.2-ANSI

Here's what I typed into the interpreter:

(load "compress.lisp")

The interpreter responds with this error:

Error in EVAL [or a callee]: Cannot open the file compress.lisp.

Fast links are on: do (use-fast-links nil) for debugging
Broken at CONDITIONS::CLCS-LOAD.  Type :H for Help.
 1 (Continue) Retry loading file "compress.lisp".
 2 (Abort) Return to top level.
dbl:>>

Is loading a file not allowed with GCL-2.6.2-ANSI? Or (more likely) I did something incorrect; if so, what?

1 个答案:

答案 0 :(得分:7)

Use PROBE-FILE to check whether there actually is a file under this name in the current directory:

CL-USER 57 > (probe-file "compress.lisp") 
NIL

Use the function si:chdir in GCL to change the current directory to the directory where the file actually is or provide a correct pathname to LOAD.