DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Computer Science (http://www.daniweb.com/forums/forum14.html)
-   -   Lisp load function in windows (http://www.daniweb.com/forums/thread69650.html)

JaggyGT Feb 10th, 2007 4:45 pm
Lisp load function in windows
 
This should be a really simple thing, but for some reason I have had no luck getting anything to work. I have CLISP and GCL, and on neither can I specify where a file is using the load function. I've tried setting the pathname, but it removes the backslashes, so its not looking in any directory, let alone the right one. Basically, I want to do this:

(load "c:\users\documents\john\schoolwork\cs\3600\project3.lisp")

But it says it can't find the file c:usersdocumentsjohnschoolworkcs3600project3.lisp

similarly when I try and set the pathname, it removes the backslashes. Anyone know what I'm donig wrong? I figure it's something really simple, but I just can't figure it out, and none of the documentation actually has examples with a windows path involved.

Thanks.

~s.o.s~ Feb 11th, 2007 1:53 pm
Re: Lisp load function in windows
 
Try using forward slashes ( / ) instead of back slashes ( \ ).

Read this.

Mushy-pea Feb 14th, 2007 11:06 am
Re: Lisp load function in windows
 
If the backslash is used to start escape sequences in Lisp, the compiler will remove it and replace it with whatever \u (for example) represents (which may be nothing). Try escaping each backslash with a backslash i.e.
(load "c:\\users\\documents\\john\\schoolwork\\cs\\3600\\project3.lisp")

If this fixes the problem it is likely this rule wil apply in all quoted strings within the language.

Steven.

rockout690 Jan 14th, 2009 12:23 pm
Re: Lisp load function in windows
 
Quote:

Originally Posted by JaggyGT (Post 313466)
This should be a really simple thing, but for some reason I have had no luck getting anything to work. I have CLISP and GCL, and on neither can I specify where a file is using the load function. I've tried setting the pathname, but it removes the backslashes, so its not looking in any directory, let alone the right one. Basically, I want to do this:

(load "c:\users\documents\john\schoolwork\cs\3600\project3.lisp")

But it says it can't find the file c:usersdocumentsjohnschoolworkcs3600project3.lisp

similarly when I try and set the pathname, it removes the backslashes. Anyone know what I'm donig wrong? I figure it's something really simple, but I just can't figure it out, and none of the documentation actually has examples with a windows path involved.

Thanks.

----------------------
Get rid of the double quotes and make them single quotes, lisp is reading your backslashes as attempted escape characters and stringing the whole thing together.

rockout690 Jan 14th, 2009 12:28 pm
Re: Lisp load function in windows
 
change the single backslashes to doubles


All times are GMT -4. The time now is 11:31 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC