Lisp Load Function

Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
Reply

Join Date: Mar 2007
Posts: 2
Reputation: WD40 is an unknown quantity at this point 
Solved Threads: 0
WD40 WD40 is offline Offline
Newbie Poster

Lisp Load Function

 
0
  #1
Mar 21st, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,055
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: Lisp Load Function

 
1
  #2
Mar 21st, 2007
You're missing a slash. You mean \\testload.
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 71
Reputation: indienick is an unknown quantity at this point 
Solved Threads: 2
indienick's Avatar
indienick indienick is offline Offline
Junior Poster in Training

Re: Lisp Load Function

 
0
  #3
Mar 22nd, 2007
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"))
Last edited by indienick; Mar 22nd, 2007 at 5:36 pm.
Angel-headed hipsters burning for the ancient heavenly connection, to the starry dynamo in the machinery of the night.
-Ginsburg

Don't tell me to "google it" - I already have.
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 2
Reputation: WD40 is an unknown quantity at this point 
Solved Threads: 0
WD40 WD40 is offline Offline
Newbie Poster

Re: Lisp Load Function

 
0
  #4
Mar 23rd, 2007
Originally Posted by Rashakil Fol View Post
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.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 3
Reputation: hexagon2008 is an unknown quantity at this point 
Solved Threads: 0
hexagon2008 hexagon2008 is offline Offline
Newbie Poster

Re: Lisp Load Function

 
0
  #5
Jul 1st, 2008
Originally Posted by WD40 View Post
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]
Last edited by Narue; Jul 1st, 2008 at 11:36 am. Reason: Snipped links
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 48
Reputation: Ken Sharpe is an unknown quantity at this point 
Solved Threads: 2
Ken Sharpe's Avatar
Ken Sharpe Ken Sharpe is offline Offline
Light Poster

Re: Lisp Load Function

 
0
  #6
Jul 1st, 2008
It could very well be a permission error. Does your program have permission to read that file?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Computer Science Forum


Views: 6467 | Replies: 5
Thread Tools Search this Thread



Tag cloud for Computer Science
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC