Unbound variables
Posted: Wed Nov 27, 2013 4:30 pm
Hi all,
I am new to Lisp and am having a little trouble. I have written some really simple programs and am trying to get them to run with GCL, but keep getting an error saying that the variables are unbound. The programs look something like this:
or this:
Like I said, when I try to run these are anything like them, I am getting an error message saying that X is unbound. When I run the functions by themselves in GCL, they do just fine. Like if I went to the GCL terminal and typed:
It would behave normally and return (X Y) as I would expect. What gives?
I am new to Lisp and am having a little trouble. I have written some really simple programs and am trying to get them to run with GCL, but keep getting an error saying that the variables are unbound. The programs look something like this:
Code: Select all
(defun test (X List)
(member 'X 'List))
Code: Select all
(defun doLoop
(do ((x 0 (+ x 2)) (y 0 (- y 2)))
((= x 2048) (print 'done))
(print x)
(print y))
)
Code: Select all
(member 'X '(A B X Y))