Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Undefined-values/Common-Lisp/undefined-values-1.lisp
Normal file
10
Task/Undefined-values/Common-Lisp/undefined-values-1.lisp
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
;; assumption: none of these variables initially exist
|
||||
|
||||
(defvar *x*) ;; variable exists now, but has no value
|
||||
(defvar *y* 42) ;; variable exists now, and has a value
|
||||
|
||||
(special-variable-p '*x*) -> T ;; Symbol *x* names a special variable
|
||||
(boundp '*x*) -> NIL ;; *x* has no binding
|
||||
(boundp '*y*) -> T
|
||||
|
||||
(special-variable-p '*z*) -> NIL ;; *z* does not name a special variable
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(makunbound '*y*) ;; *y* no longer has a value; it is erroneous to evaluate *y*
|
||||
|
||||
(setf *y* 43) ;; *y* is bound again.
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
(defvar *dyn*) ;; special, no binding
|
||||
|
||||
(let (*dyn* ;; locally scoped override, value is nil
|
||||
lex) ;; lexical, value is nil
|
||||
(list (boundp '*dyn*) *dyn* (boundp 'lex) lex)) -> (T NIL NIL NIL)
|
||||
|
||||
(boundp '*global*) -> NIL
|
||||
Loading…
Add table
Add a link
Reference in a new issue