質問

So I have been trying to learn Lisp lately. Unfortunately, nothing seems to work - I am following this Common Lisp tutorial but when I tried to run (hello-world) a second time, instead of doing the same thing it gave me an error (Which I lost, because I didn't think to save it) about how CL-USER> was an undefined variable. I have never typed CL-USER> into SLIME, but that IS what the prompt is. I restarted EMACS and SLIME (Closed the window, that is) and restarted it. However, upon tryig to use the (load "name") method, it gave me the following error:

Compiler warnings for "helloworld.cl" :
;   In an anonymous lambda form at position 43: Undeclared free variable CL-USER>
;   In an anonymous lambda form at position 52: Undeclared free variable CL-USER>
;   In an anonymous lambda form at position 58: Undeclared free variable ..\sOURCECODELISP\hELLOWORLD.CL
;   In an anonymous lambda form at position 161: Undeclared free variable CL-USER>
;   In an anonymous lambda form at position 278: Undeclared free variable CL-USER>
;   In an anonymous lambda form at position 389: Undeclared free variable CL-USER>
Read error between positions 441 and 450 in f:/Lispbox/helloworld.cl.; Evaluation aborted on #<SIMPLE-ERROR #x2100B925AD>.

How can I fix it?

EDIT: After closing it, going to my next few classes, then staying after school, the problem persists, but now it just complains that CL-USER> is not a defined variable.

FYI, I originally attempted to load my file from ..\sourcecode\Lisp\helloworld.cl because that's where I put it at first. I forgot quotes around it, so that may have caused the problem.

役に立ちましたか?

解決

When you copied code from an interactive session to the file helloworld.cl, you should have removed the prompts and interaction messages.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top