X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/88b38efdc57dffee6f83ea881a1740531b97754c..e82044bca1b6cfe495de93abbff727a5b41359b8:/src/module-impl.lisp?ds=inline diff --git a/src/module-impl.lisp b/src/module-impl.lisp index 08679ce..0bf9ff2 100644 --- a/src/module-impl.lisp +++ b/src/module-impl.lisp @@ -51,8 +51,7 @@ ;; 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. @@ -87,7 +86,8 @@ (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*))))) @@ -196,7 +196,8 @@ (defmethod make-load-form ((fragment c-fragment) &optional environment) (make-load-form-saving-slots fragment :environment environment)) -(export 'code-fragment-item) +(export '(code-fragment-item code-fragment code-fragment-reason + code-fragment-name code-fragment-constraints)) (defclass code-fragment-item () ((fragment :initarg :fragment :type c-fragment :reader code-fragment) (reason :initarg :reason :type keyword :reader code-fragment-reason) @@ -206,24 +207,6 @@ (:documentation "A plain fragment of C to be dropped in at top-level.")) -(defmacro define-fragment ((reason name) &body things) - (categorize (thing things) - ((constraints (listp thing)) - (frags (typep thing '(or string c-fragment)))) - (when (null frags) - (error "Missing code fragment")) - (when (cdr frags) - (error "Multiple code fragments")) - `(add-to-module - *module* - (make-instance 'code-fragment-item - :fragment ',(car frags) - :name ,name - :reason ,reason - :constraints (list ,@(mapcar (lambda (constraint) - (cons 'list constraint)) - constraints)))))) - ;;;-------------------------------------------------------------------------- ;;; File searching.