Prime Number in clisp : Well I'm just completely new to CLISP programming language and I have started learning this language by my own from yesterday and that too out of interest.Now when i came across functions and loop,after learning about them I started developing the Prime Number problem in CLISP.
My code is as follows:
 
(defun prime (num)

(setq c 1)

(setq a 2)

(loop 

(setq a (+ 1 a))

(if (= (mod num a) 0)

(setq c (+ c 1))

)

(when (> (+ a 1) 17) (return a))

)
)

(if (= c 1)
(return-from prime num)
)
)

(loop for x from 1 to 20
do (prime x)
)

Now the problem which I am facing with this code is that whenever I am trying to execute this code the error which I am getting is as follows:

***IF: variable C has no value

but I've declared a value to c already still it's appearing. So all i want to know is that why this error is appearing even though i have declared it.