Commit d9f2baa8 by Francois-Rene Rideau

Replace reset-system by reset-system-class

Drop any information in undefined-system that isn't in proto-system.
parent 0a311c7a
......@@ -310,7 +310,8 @@ system names contained using COERCE-NAME. Return the result."
dep-forms))
(system (or (find-system-if-being-defined name)
(if-let (registered (registered-system name))
(reset-system registered :name name :source-file source-file)
(reset-system-class registered 'undefined-system
:name name :source-file source-file)
(register-system (make-instance 'undefined-system
:name name :source-file source-file)))))
(component-options
......@@ -328,7 +329,7 @@ system names contained using COERCE-NAME. Return the result."
(unless (subtypep class 'system)
(error 'non-system-system :name name :class-name (class-name class)))
(unless (eq (type-of system) class)
(change-class system class)))
(reset-system-class system class)))
(parse-component-form nil (list* :module name :pathname directory component-options))))
(defmacro defsystem (name &body options)
......
......@@ -5,7 +5,7 @@
(:recycle :asdf :asdf/system :asdf/find-system)
(:use :uiop/common-lisp :uiop :asdf/upgrade :asdf/session :asdf/component)
(:export
#:system #:proto-system #:undefined-system #:reset-system
#:system #:proto-system #:undefined-system #:reset-system-class
#:system-source-file #:system-source-directory #:system-relative-pathname
#:system-description #:system-long-description
#:system-author #:system-maintainer #:system-licence #:system-license
......@@ -105,10 +105,10 @@ ASDF to build."))
(defclass undefined-system (system) ()
(:documentation "System that was not defined yet."))
(defun reset-system (system &rest keys &key &allow-other-keys)
(defun reset-system-class (system new-class &rest keys &key &allow-other-keys)
"Erase any data from a SYSTEM except its basic identity, then reinitialize it
based on supplied KEYS."
(change-class (change-class system 'proto-system) 'undefined-system)
(change-class (change-class system 'proto-system) new-class)
(apply 'reinitialize-instance system keys)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment