setq and defvar in Lisp
I see that the Practical Common Lisp uses (defvar *db* nil) for setting up a global variable . Isn't it OK to use setq for the same purpose? What are the advantages/disadvantages of using defvar vs. setq ? There are several ways to introduce variables. DEFVAR and DEFPARAMETER introduce global dynamic variables. DEFVAR optionally sets it to some value, unless it is already defined. DEFPARAMETER sets it always to the provided value. SETQ does not introduce a variable. (defparameter *number-of-processes* 10) (defvar *world* (make-world)) ; the world is made only once. Notice that you likely never