Commit af3e41a7 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Explicitly use defun* and defgeneric* when redefining a function

The previous use of defun (foo) () relying on with-upgradability was confusing
to new developers reading the code. Explicitly using defun* and defgeneric* in
these cases makes the code less surprising and less confusing to readers.
parent 84f3c5ae
......@@ -49,7 +49,7 @@
(:documentation "Top-level system containing the COMPONENT"))
(defgeneric component-pathname (component)
(:documentation "Pathname of the COMPONENT if any, or NIL."))
(defgeneric (component-relative-pathname) (component)
(defgeneric* (component-relative-pathname) (component)
;; in ASDF4, rename that to component-specified-pathname ?
(:documentation "Specified pathname of the COMPONENT,
intended to be merged with the pathname of that component's parent if any, using merged-pathnames*.
......@@ -78,7 +78,7 @@ or NIL for top-level components (a.k.a. systems)"))
;; Deprecated: Backward compatible way of computing the FILE-TYPE of a component.
;; TODO: find users, have them stop using that, remove it for ASDF4.
(defgeneric (source-file-type) (component system)
(defgeneric* (source-file-type) (component system)
(:documentation "DEPRECATED. Use the FILE-TYPE of a COMPONENT instead."))
(define-condition system-definition-error (error) ()
......
......@@ -189,7 +189,7 @@
system names contained using COERCE-NAME. Return the result."
(mapcar 'parse-dependency-def dd-list))
(defun (parse-component-form) (parent options &key previous-serial-component)
(defun* (parse-component-form) (parent options &key previous-serial-component)
(destructuring-bind
(type name &rest rest &key
(builtin-system-p () bspp)
......
......@@ -200,7 +200,7 @@ to be meaningful, or could it just as well have been done in another Lisp image?
;;;; Visiting dependencies of an action and computing action stamps
(with-upgradability ()
(defun (map-direct-dependencies) (plan operation component fun)
(defun* (map-direct-dependencies) (plan operation component fun)
"Call FUN on all the valid dependencies of the given action in the given plan"
(loop* :for (dep-o-spec . dep-c-specs) :in (component-depends-on operation component)
:for dep-o = (find-operation operation dep-o-spec)
......@@ -210,7 +210,7 @@ to be meaningful, or could it just as well have been done in another Lisp image?
:when (and dep-c (action-valid-p plan dep-o dep-c))
:do (funcall fun dep-o dep-c))))
(defun (reduce-direct-dependencies) (plan operation component combinator seed)
(defun* (reduce-direct-dependencies) (plan operation component combinator seed)
"Reduce the direct dependencies to a value computed by iteratively calling COMBINATOR
for each dependency action on the dependency's operation and component and an accumulator
initialized with SEED."
......@@ -220,7 +220,7 @@ initialized with SEED."
(setf seed (funcall combinator dep-o dep-c seed))))
seed)
(defun (direct-dependencies) (plan operation component)
(defun* (direct-dependencies) (plan operation component)
"Compute a list of the direct dependencies of the action within the plan"
(reduce-direct-dependencies plan operation component #'acons nil))
......@@ -514,7 +514,7 @@ initialized with SEED."
(typep c (plan-component-type plan))
(call-next-method)))
(defun (traverse-actions) (actions &rest keys &key plan-class &allow-other-keys)
(defun* (traverse-actions) (actions &rest keys &key plan-class &allow-other-keys)
"Given a list of actions, build a plan with these actions as roots."
(let ((plan (apply 'make-instance (or plan-class 'filtered-sequential-plan) keys)))
(loop* :for (o . c) :in actions :do (traverse-action plan o c t))
......@@ -533,7 +533,7 @@ initialized with SEED."
:when (and (typep o keep-operation) (typep c keep-component))
:collect (cons o c))))
(defun (required-components) (system &rest keys &key (goal-operation 'load-op) &allow-other-keys)
(defun* (required-components) (system &rest keys &key (goal-operation 'load-op) &allow-other-keys)
"Given a SYSTEM and a GOAL-OPERATION (default LOAD-OP), traverse the dependencies and
return a list of the components involved in building the desired action."
(remove-duplicates
......
......@@ -116,7 +116,7 @@ based on supplied KEYS."
in which the system specification (.asd file) is located."
(pathname-directory-pathname (system-source-file system-designator)))
(defun (system-relative-pathname) (system name &key type)
(defun* (system-relative-pathname) (system name &key type)
"Given a SYSTEM, and a (Unix-style relative path) NAME of a file (or directory) of given TYPE,
return the absolute pathname of a corresponding file under that system's source code pathname."
(subpathname (system-source-directory system) name :type type))
......
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