colon in text file causes hiccups
Posted: Mon Feb 16, 2009 3:25 pm
What am I doing wrong here? I saved this very short program as 'test.lsp':
(set 'infile (open (main-args 2) "r"))
(print (read-line infile) "\n")
(close infile)
It is in a directory with this very short file called 'test.txt':
a_label:
If I run this on the Windows console command line:
newlisp test.lsp test.txt
I get:
a_label:
ERR: symbol expected : "a_label:"
and am back in the command console.
If I change test.txt to:
a_label
It opens the file, prints 'a_label', and leaves me in newlisp, where I should be.
What is that colon doing?
John
(Oops, edited, because in the original posting I left out the 'a_label:' which atually gets printed)
(set 'infile (open (main-args 2) "r"))
(print (read-line infile) "\n")
(close infile)
It is in a directory with this very short file called 'test.txt':
a_label:
If I run this on the Windows console command line:
newlisp test.lsp test.txt
I get:
a_label:
ERR: symbol expected : "a_label:"
and am back in the command console.
If I change test.txt to:
a_label
It opens the file, prints 'a_label', and leaves me in newlisp, where I should be.
What is that colon doing?
John
(Oops, edited, because in the original posting I left out the 'a_label:' which atually gets printed)