Commit 11722c11 authored by Gary King's avatar Gary King
Browse files

replaces calls to gethash with the system-registered-p abstraction.

parent 2dc7559f
;;; This is asdf: Another System Definition Facility. $Revision: 1.123 $ ;;; This is asdf: Another System Definition Facility. $Revision: 1.124 $
;;; ;;;
;;; Feedback, bug reports, and patches are all welcome: please mail to ;;; Feedback, bug reports, and patches are all welcome: please mail to
;;; <cclan-list@lists.sf.net>. But note first that the canonical ;;; <cclan-list@lists.sf.net>. But note first that the canonical
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
(in-package #:asdf) (in-package #:asdf)
(defvar *asdf-revision* (let* ((v "$Revision: 1.123 $") (defvar *asdf-revision* (let* ((v "$Revision: 1.124 $")
(colon (or (position #\: v) -1)) (colon (or (position #\: v) -1))
(dot (position #\. v))) (dot (position #\. v)))
(and v colon dot (and v colon dot
...@@ -375,7 +375,7 @@ and NIL NAME and TYPE components" ...@@ -375,7 +375,7 @@ and NIL NAME and TYPE components"
(or (or
(some (lambda (x) (funcall x system-name)) (some (lambda (x) (funcall x system-name))
*system-definition-search-functions*) *system-definition-search-functions*)
(let ((system-pair (gethash system-name *defined-systems*))) (let ((system-pair (system-registered-p system-name)))
(and system-pair (and system-pair
(system-source-file (cdr system-pair))))))) (system-source-file (cdr system-pair)))))))
...@@ -407,7 +407,7 @@ and NIL NAME and TYPE components" ...@@ -407,7 +407,7 @@ and NIL NAME and TYPE components"
(defun find-system (name &optional (error-p t)) (defun find-system (name &optional (error-p t))
(let* ((name (coerce-name name)) (let* ((name (coerce-name name))
(in-memory (gethash name *defined-systems*)) (in-memory (system-registered-p name))
(on-disk (system-definition-pathname name))) (on-disk (system-definition-pathname name)))
(when (and on-disk (when (and on-disk
(or (not in-memory) (or (not in-memory)
...@@ -424,7 +424,7 @@ and NIL NAME and TYPE components" ...@@ -424,7 +424,7 @@ and NIL NAME and TYPE components"
*package*) *package*)
(load on-disk)) (load on-disk))
(delete-package package)))) (delete-package package))))
(let ((in-memory (gethash name *defined-systems*))) (let ((in-memory (system-registered-p name)))
(if in-memory (if in-memory
(progn (if on-disk (setf (car in-memory) (file-write-date on-disk))) (progn (if on-disk (setf (car in-memory) (file-write-date on-disk)))
(cdr in-memory)) (cdr in-memory))
...@@ -432,12 +432,13 @@ and NIL NAME and TYPE components" ...@@ -432,12 +432,13 @@ and NIL NAME and TYPE components"
(defun register-system (name system) (defun register-system (name system)
(format *verbose-out* "~&~@<; ~@;registering ~A as ~A~@:>~%" system name) (format *verbose-out* "~&~@<; ~@;registering ~A as ~A~@:>~%" system name)
(setf (gethash (coerce-name name) *defined-systems*) (setf (gethash (coerce-name name) *defined-systems*)
(cons (get-universal-time) system))) (cons (get-universal-time) system)))
(defun system-registered-p (name) (defun system-registered-p (name)
(gethash (coerce-name name) *defined-systems*)) (gethash (coerce-name name) *defined-systems*))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; finding components ;;; finding components
......
Supports Markdown
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