I have written a function using the DO macro (using Peter Seibel's book as reference) but for some reason, when I compile my function:
(defun test ()
(do ((n 2 (1+ n))
(m 1 (1+ m))
(a (1+ n))
(b (1+ m))
(c (+ n m)))
((= n 10) (* a b c))
(print (* a b c))))
I get the following warning messages:
WARNING: in TEST in lines 1..10 : N is neither declared nor bound,
it will be treated as if it were declared SPECIAL.
WARNING: in TEST in lines 1..10 : M is neither declared nor bound,
it will be treated as if it were declared SPECIAL.
WARNING: in TEST in lines 1..10 : N is neither declared nor bound,
it will be treated as if it were declared SPECIAL.
WARNING: in TEST in lines 1..10 : M is neither declared nor bound,
it will be treated as if it were declared SPECIAL.
When I try to execute test
, it says that n
has no value.
I am under the impression that the order of binding doesn't matter, but I tried rearranging it anyway and still received the same result.
What am I missing here?
I am using CLISP 2.49