Have `*module-map*' initialized in strictly one place, rather than a
`defparameter' and sneakily in `test-module'. This is now a
`clear-the-decks' operation. Use `defvar-unbound' to leave a trap for
the incautious who try to use it before the decks are cleared.
(add-to-module module class))))
(export '*builtin-module*)
-(defvar *builtin-module* nil
+(defvar-unbound *builtin-module*
"The builtin module.")
(export 'make-builtin-module)
(setf *builtin-module* module)))
(define-clear-the-decks builtin-module
- (unless *builtin-module* (make-builtin-module)))
+ (unless (boundp '*builtin-module*) (make-builtin-module)))
;;;----- That's all, folks --------------------------------------------------
(defun test-module (path reason)
"Reset the translator's state, read a module from PATH and output it with
REASON, returning the result as a string."
- (setf *module-map* (make-hash-table :test #'equal))
(with-open-file (out *debugout-pathname*
:direction :output
:if-exists :supersede
;;;--------------------------------------------------------------------------
;;; Module objects.
-(defparameter *module-map* (make-hash-table :test #'equal)
+(defvar-unbound *module-map*
"Hash table mapping true names to module objects.")
+(define-clear-the-decks reset-module-map
+ (setf *module-map* (make-hash-table :test #'equal)))
(defun build-module
(name thunk &key (truename (probe-file name)) location)