Лисп изучаю только второй час, так что сильно пинать меня не стоит.
Проблема вот в чем.
Пробую:
$ gcl
GCL (GNU Common Lisp) 2.6.7 CLtL1 Feb 1 2012 09:07:26
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License: GPL due to GPL'ed components: (XGCL READLINE UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/
>(setf a (read))
10
10
>a
10
все работает так, как я ожидаю.
Но как только я пробую вот это:
$ cat ./sqare.lsp
(format t "a*x^2 + b*x + c = 0")
(let ((a 0)) )
(format t "~%a=")
(setf a (read))
(format t "~%b=")
(setf (b (read)))
(format t "~%c=")
(setf (c (read)))
(format t "~%")
(setq d (- (* b b) (* 4 a c)))
$ gcl -load ./sqare.lsp
GCL (GNU Common Lisp) 2.6.7 CLtL1 Feb 1 2012 09:07:26
Source License: LGPL(gcl,gmp), GPL(unexec,bfd,xgcl)
Binary License: GPL due to GPL'ed components: (XGCL READLINE UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter
Use (help) to get some basic information on how to use GCL.
Temporary directory for compiler files set to /tmp/
a*x^2 + b*x + c = 0
a=
Error: No value for (B (READ)).
Fast links are on: do (si::use-fast-links nil) for debugging
Error signalled by SETF.
Broken at SETF. Type :H for Help.
>>
Собственно вопрос, почему так происходит?
P.S. Лисп изучаю по свежекуленной книге Пола Грема "ANSI Common Lisp".pdf