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
|
CPRD
|
||||||
CRPR
|
CRPR
|
||||||
D
|
D
|
||||||
|
DEF
|
||||||
F
|
F
|
||||||
DFFR
|
DFFR
|
||||||
DGNL
|
DGNL
|
||||||
|
|||||||
@ -6,6 +6,25 @@
|
|||||||
|
|
||||||
(PROVIDE "macros")
|
(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
|
;;; VARIOUS
|
||||||
;;;
|
;;;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user