src/utilities.lisp (defvar-unbound): Make a variable with docs and no value.
[sod] / src / utilities.lisp
index 72423fd..72af8b3 100644 (file)
     (reduce #'compose1 more-functions :initial-value function)))
 
 ;;;--------------------------------------------------------------------------
+;;; Variables.
+
+(export 'defvar-unbound)
+(defmacro defvar-unbound (var doc)
+  "Make VAR a special variable with documentation DOC, but leave it unbound."
+  `(eval-when (:compile-toplevel :load-toplevel :execute)
+     (defvar ,var)
+     (setf (documentation ',var 'variable) ',doc)
+     ',var))
+
+;;;--------------------------------------------------------------------------
 ;;; Symbols.
 
 (export 'symbolicate)