When I use setf in the repl it works fine, but if I try to use it in a file and then compile it and send it to the repl, it gives an error. Why am I seeing this strange behavior?
Works fine in repl:
(setf books
'((war-and-peace leo-tolstoy)
(spin charles-wilson)
(harry-potter jk-rowling)
(speaker-for-the-dead orson-scott-card)))
Gives this error when compiled from file:
clagitsc.lisp:187:1:
warning:
BOOKS is neither declared nor bound,
it will be treated as if it were declared SPECIAL.
warning:
in #:|187 193 (SETF BOOKS '(# # # ...))-34| in lines 187..193 : BOOKS is neither
declared nor bound,
it will be treated as if it were declared SPECIAL.
Compilation failed.
I'm using slime with emacs 24.3 on windows with CLisp 2.49 and I'm working my way through Common Lisp: A Gentle Introduction to Symbolic Computation.