954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Lisp Load Function

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

WD40
Newbie Poster
2 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

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

Rashakil Fol
Super Senior Demiposter
Team Colleague
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
 

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 snippetshould 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"))

indienick
Junior Poster in Training
71 posts since Aug 2005
Reputation Points: 23
Solved Threads: 2
 
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.

WD40
Newbie Poster
2 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

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]

hexagon2008
Newbie Poster
3 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

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

Ken Sharpe
Light Poster
48 posts since Jul 2008
Reputation Points: 33
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You