PDA

View Full Version : Error:EOF after quote on input



csgohjmj
2004-07-15, 01:32 PM
Hi;
I have been getting the title error when I run the attached lisp prog in Acad 2000 and above but not Acad R14. I cannot figure out what's wrong and I have noted the error line in the attached file. I hope to get some help. Thanks.

csgoh

stig.madsen
2004-07-15, 02:55 PM
Because READ respects certain characters reserved for lisp evaluations. A quote "'" is read as the function QUOTE:

(read "a") returns the symbol A, but
(read "'a") returns (QUOTE A)

It's the same thing that makes READ capable of returning lisp expressions, as in

(read "(cons 2 4)")
where the left parenthesis signals a lisp expression. Whenever READ bumps into a reserved character it expects an expression to follow. You'll have to check the returned character before using READ.

csgohjmj
2004-07-16, 12:02 PM
Hi;

If that's the case, then the prog should not work in Autocad R14 at all but it is working well and there is no problem in R14.

But when tested in 2000 and above it crashes.

Any further enlightenment is much appreciated. Thanks.

csgoh
16-7-04

stig.madsen
2004-07-16, 03:50 PM
That is the case. I can't remember how READ evaluated arguments back in r14 but if you check characters before READ'ing them, it should work in r14 as well.