chiark / gitweb /
src/module-impl.lisp: Don't require `finalize-module' to return the module.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 22 Sep 2015 10:27:11 +0000 (11:27 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 23 Sep 2015 09:00:47 +0000 (10:00 +0100)
Returning the correct module object is now the responsibility of
`build-module'.

src/module-impl.lisp

index c15eddaa15f203fd213cdc507c96338b5b9cf68c..0bf9ff2df34e49790aff26d3398e1b457da2470b 100644 (file)
@@ -51,8 +51,7 @@ (defmethod finalize-module ((module module))
     ;; exercise the property-set fiddling in `shared-initialize' and we can
     ;; catch unknown-property errors.
     (change-class module class :state t :pset pset)
     ;; exercise the property-set fiddling in `shared-initialize' and we can
     ;; catch unknown-property errors.
     (change-class module class :state t :pset pset)
-    (check-unused-properties pset)
-    module))
+    (check-unused-properties pset)))
 
 ;;;--------------------------------------------------------------------------
 ;;; Module objects.
 
 ;;;--------------------------------------------------------------------------
 ;;; Module objects.
@@ -87,7 +86,8 @@ (defun build-module
         (with-module-environment ()
           (module-import *builtin-module*)
           (funcall thunk)
         (with-module-environment ()
           (module-import *builtin-module*)
           (funcall thunk)
-          (finalize-module *module*))
+          (finalize-module *module*)
+          *module*)
       (when (and truename (not (eq (module-state *module*) t)))
        (remhash truename *module-map*)))))
 
       (when (and truename (not (eq (module-state *module*) t)))
        (remhash truename *module-map*)))))