I am using common lisp for customizing CoCreate Cad software.
I am confused regarding the load function.

The following command will load the indicated file:
(load "c:\\temp\\testload")

The following will load the 2nd item but the 1st item exists:
(load "c:\\temp\testload"
if-does-not-exist
(load "c:\\temp\\testload2")
)

Could somebody please explain why the testload will not load, even though it exists?

The files do not have a file extension and I'd like to run it this way.

Thank You
Bill

Recommended Answers

All 5 Replies

You're missing a slash. You mean \\testload.

When referring to file paths in Common LISP, it's best to either use the pathname directive: (load #p("/path/to/file") -or-
...better yet, just use the arbitrary pathname tricks in Common LISP:

(load (make-pathname
         :device "c"
         :directory '(:absolute "temp")
         :name "testload"))

Now, however, there's a problem with the syntax of your code; proper Common LISP code for your little snippet should read (NOTE: This example's using arbitrary pathnames.):

(load (make-pathname
         :device "c"
         :directory '(:absolute "temp")
         :name "testload")
  :if-does-not-exist (load (make-pathname :device "c" :directory '(:absolute "temp") :name "testload2"))

You're missing a slash. You mean \\testload.

This was a typing error in this message. The code has the proper backslash and it still will not work properly.

I am using common lisp for customizing CoCreate Cad software.
I am confused regarding the load function.

The following command will load the indicated file:
(load "c:\\temp\\testload")

The following will load the 2nd item but the 1st item exists:
(load "c:\\temp\testload"
if-does-not-exist
(load "c:\\temp\\testload2")
)

Could somebody please explain why the testload will not load, even though it exists?

The files do not have a file extension and I'd like to run it this way.

Thank You
Bill

Hi

click on following link. read lisp load function.

http://www.lisp.org/HyperSpec/Body/fun_load.html

From
Hexagon software
[removed links]

It could very well be a permission error. Does your program have permission to read that file?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.