23 lines
557 B
Common Lisp
23 lines
557 B
Common Lisp
;;; DYNAMIC 4: DEFVAR VS DEFPARAMETER (solution)
|
|
|
|
(defvar *cache* 10)
|
|
(defparameter *config* 10)
|
|
|
|
(setf *cache* 99)
|
|
(setf *config* 99)
|
|
|
|
(defvar *cache* 10)
|
|
(defparameter *config* 10)
|
|
|
|
(defun current-values ()
|
|
(list *cache* *config*))
|
|
|
|
;;; ------------------------------------------------------------------
|
|
;;; Checks. Read them - they tell you what to aim for - but leave
|
|
;;; them unchanged.
|
|
;;; ------------------------------------------------------------------
|
|
|
|
(check-equal '(99 10) (current-values))
|
|
(check-equal 99 *cache*)
|
|
(check-equal 10 *config*)
|