Commit 9fe46091 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Update comments and docstrings in operation.lisp

parent dae26ef5
......@@ -20,11 +20,20 @@
(with-upgradability ()
(defclass operation ()
((original-initargs ;; for backward-compat -- used by GBBopen and swank (via operation-forced)
:initform nil :initarg :original-initargs :accessor operation-original-initargs)))
((original-initargs ;; for backward-compat -- used by GBBopen, and swank (via operation-forced)
:initform nil :initarg :original-initargs :accessor operation-original-initargs))
(:documentation "The base class for all ASDF operations.
;; Cache a copy of the INITARGS in the ORIGINAL-INITARGS slot, if that slot is not
;; already bound.
ASDF does NOT, never did and never will distinguish between multiple operations of the same class.
Therefore, all slots of all operations must have (:allocation class) and no initargs.
Any exceptions currently maintained for backward-compatibility are deprecated,
and support for them may be discontinued at any moment.
;; Cache a copy of the INITARGS in the ORIGINAL-INITARGS slot, if that slot is not already bound.
;; This is a deprecated feature temporarily maintained for backward compatibility.
;; It will be removed at some point in the future.
(defmethod initialize-instance :after ((o operation) &rest initargs
&key force force-not system verbose &allow-other-keys)
(declare (ignore force force-not system verbose))
......@@ -39,14 +48,23 @@
;;; make-operation, find-operation
(with-upgradability ()
;; A table to memoize instances of a given operation. There shall be only one.
(defparameter* *operations* (make-hash-table :test 'equal))
;; A memoizing way of creating instances of operation.
;; All operations MUST created through this function.
(defun make-operation (operation-class &rest initargs)
"This function creates and memoizes an instance of OPERATION-CLASS.
Use of INITARGS is for backward compatibility and may be discontinued at any time."
(let ((class (coerce-class operation-class
:package :asdf/interface :super 'operation :error 'sysdef-error)))
(ensure-gethash (cons class initargs) *operations*
(list* 'make-instance class initargs))))
;; We preserve the operation-original-initargs of the context,
;; but only as an unsupported feature.
;; This is all done purely for the temporary sake of backwards compatibility.
(defgeneric find-operation (context spec)
(:documentation "Find an operation by resolving the SPEC in the CONTEXT"))
(defmethod find-operation ((context t) (spec operation))
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