title: LISP Changing a global variable value in a local function
body: <p>I am a novice in the field of lisp... i am writing a code to solve the 8 puzzle in bfs...</p>
  
  <p>I want to store the visited lists in a global list and change its value regularly from within a function...</p>
  
  <pre><code>(defparameter *vlist* nil)
  (defun bfs-core(node-list)
          (let (cur-node tmp-node-list)
              (if (null node-list)
                  NIL
                  (progn
                  ;       (if (= 1 (length node-list)) 
                      (setq cur-node (car node-list))
                      (setq tmp-node-list (cdr node-list))
                      (if (goalp  cur-node)
                          cur-node
                      ((setq *vlist* (append cur-node *vlist*))
                         (bfs-core (append tmp-node-list (expand cur-node))))))
                      )
                  )
              )
  </code></pre>
  
  <p>The defparameter one is my global variable... and witjin the function i want to change its value with setq... i have also used defvar, setf,set and all possible combinations.....
  Can anyone help me out????</p>