src/{builtin,final,frontent}.lisp: `clear-the-decks' makes builtin module.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 14 Sep 2015 09:40:23 +0000 (10:40 +0100)
Add a `clear-the-decks' function which will make the builtin module if
it's not been set up yet.  Now we don't need to do this explicitly and
everything is better.

src/builtin.lisp
src/final.lisp
src/frontend.lisp

index 696bcf6..5aad5f5 100644 (file)
@@ -332,4 +332,7 @@ static const SodClass *const ~A__cpl[] = {
       (bootstrap-classes module))
     (setf *builtin-module* module)))
 
+(define-clear-the-decks builtin-module
+  (unless *builtin-module* (make-builtin-module)))
+
 ;;;----- That's all, folks --------------------------------------------------
index 12b6294..5df72f1 100644 (file)
@@ -35,7 +35,6 @@
 (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."
-  (unless *builtin-module* (make-builtin-module))
   (clear-the-decks)
   (setf *module-map* (make-hash-table :test #'equal))
   (with-open-file (out *debugout-pathname*
index 26afbfc..98652ec 100644 (file)
@@ -32,7 +32,7 @@
 ;;;--------------------------------------------------------------------------
 ;;; Preparation for dumping.
 
-(make-builtin-module)
+(clear-the-decks)
 (exercise)
 
 ;;;--------------------------------------------------------------------------