1

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
  • 1
    can you add the file compres.lisp, maybe the only problem is the path to this file, try to write the complete path to the file Commented Sep 1, 2015 at 22:02

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks! I tried using the full pathname: (load "C:\Users\costello\Documents\Lisp\compress.lisp") but that resulted in producing this error message: Error in EVAL [or a callee]: Cannot open the file C:UserscostelloDocumentsLispco mpress.lisp. With regard to your other recommendation, I don't know how to use si:chdir. Do I use it at the Lisp interpreter command line?
@RogerCostello: \ is a character quoting character in Common Lisp. You have to write "c:\\foo\\bar.com". if si:chdir is a Lisp function, how would you use it? Probably reading the GCL documentation also helps with using it...
Escaping each backslash in the file path did the trick. (Embarrassed) Yes, reading the GCL documentation is a good idea. Thanks again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.