Added DEF macro to define dynamic variables in user space and get
around the 'undefined variable' warnings when using SETF without prior variable declaration.
This commit is contained in:
parent
71596227c8
commit
c1fbc5ab70
@ -405,6 +405,7 @@
|
||||
CPRD
|
||||
CRPR
|
||||
D
|
||||
DEF
|
||||
F
|
||||
DFFR
|
||||
DGNL
|
||||
|
||||
@ -6,6 +6,25 @@
|
||||
|
||||
(PROVIDE "macros")
|
||||
|
||||
|
||||
;;;
|
||||
;;; UTILITIES
|
||||
|
||||
|
||||
(defmacro def (name value)
|
||||
(declare (type symbol name))
|
||||
"-----------------------------------------------------------------[macro-doc]
|
||||
DEF
|
||||
Args: (name value)
|
||||
Defines a dynamic variable NAME in the CL-USER package, assigns it VALUE,
|
||||
and returns VALUE.
|
||||
------------------------------------------------------------------------------"
|
||||
`(progn
|
||||
(intern (symbol-name ',name))
|
||||
(defparameter ,name nil)
|
||||
(setq ,name ,value)))
|
||||
|
||||
|
||||
;;;
|
||||
;;; VARIOUS
|
||||
;;;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user