diff --git a/doc/asdf.texinfo b/doc/asdf.texinfo index a26dfa8f2e85e276f92aec11698a611d0901b81e..9d62311227c80bb35774ce541eec939df5e3451e 100644 --- a/doc/asdf.texinfo +++ b/doc/asdf.texinfo @@ -2388,13 +2388,17 @@ the file's @code{last-modified} time exceeds the @code{last-modified} time of the system in memory @end itemize +@cindex ASDF-USER package When system definitions are loaded from @file{.asd} files, -a new scratch package is created for them to load into, -so that different systems do not overwrite each others operations. -The user may also wish to (and is recommended to) +they are implicitly loaded into the @code{ASDF-USER} package, which uses +@code{ASDF}. +The programmer is also recommended to include @code{defpackage} and @code{in-package} forms -in his system definition files, however, -so that they can be loaded manually if need be. +in his system definition files, however, so that they +will behave identically if loaded manually for development or debugging. +One should define one's own package (typically using @code{ASDF} and +@code{COMMON-LISP}) if adding new classes, methods, etc., in order that +different systems do not overwrite each others' extensions. The default value of @code{*system-definition-search-functions*} is a list of two functions. @@ -2409,6 +2413,25 @@ Hence, it is strongly advised to define a system @var{foo} in the corresponding file @var{foo.asd}. @end defun +@defun locate-system name + +This function should typically @emph{not} be invoked directly. It is +exported as part of the API only for programmers who wish to provide +their own @code{*system-definition-search-functions*}. + +Given a system @var{name} designator, try to locate where to load the system from. +Returns five values: @var{foundp}, @var{found-system}, @var{pathname}, +@var{previous}, and @var{previous-time}. +@var{foundp} is true when a system was found, +either a new as yet unregistered one, or a previously registered one. +@var{found-system} when not null is a @code{system} object that may be @code{register-system}'ed. +@var{pathname} when not null is a path from which to load the system, +either associated with @var{found-system}, or with the @var{previous} system. +@var{previous} when not null is a previously loaded @code{system} object +of the same name. +@var{previous-time} when not null is the time at which the @var{previous} system was loaded. +@end defun + @defun find-component base path Given a @var{base} component (or designator for such), diff --git a/find-system.lisp b/find-system.lisp index fde016c3dc59793d97ab4b57cc639eb68b40b768..b85c4f911982cf44153988affcc5a93017151d77 100644 --- a/find-system.lisp +++ b/find-system.lisp @@ -99,8 +99,8 @@ of which is a system object.") (defun clear-defined-systems () ;; Invalidate all systems but ASDF itself, if registered. (loop :for name :being :the :hash-keys :of *defined-systems* - :unless (equal name "asdf") - :do (clear-defined-system name))) + :unless (equal name "asdf") + :do (clear-defined-system name))) (register-hook-function '*post-upgrade-cleanup-hook* 'clear-defined-systems nil) @@ -353,8 +353,8 @@ but not loaded in memory" Returns five values: FOUNDP FOUND-SYSTEM PATHNAME PREVIOUS PREVIOUS-TIME FOUNDP is true when a system was found, either a new unregistered one or a previously registered one. -FOUND-SYSTEM when not null is a SYSTEM object that may be REGISTER-SYSTEM'ed as is -PATHNAME when not null is a path from where to load the system, +FOUND-SYSTEM when not null is a SYSTEM object that may be REGISTER-SYSTEM'ed. +PATHNAME when not null is a path from which to load the system, either associated with FOUND-SYSTEM, or with the PREVIOUS system. PREVIOUS when not null is a previously loaded SYSTEM object of same name. PREVIOUS-TIME when not null is the time at which the PREVIOUS system was loaded." @@ -426,6 +426,6 @@ PREVIOUS-TIME when not null is the time at which the PREVIOUS system was loaded. (reinitialize-source-registry-and-retry () :report (lambda (s) (format s (compatfmt "~@<Retry finding system ~A after reinitializing the source-registry.~@:>") name)) - (unset-asdf-cache-entry `(locate-system ,name)) + (unset-asdf-cache-entry `(locate-system ,name)) (initialize-source-registry)))))))