Created
August 30, 2011 22:15
-
-
Save bowbow99/1182248 to your computer and use it in GitHub Desktop.
#xyzzy require で読み込まれたのに provide してない奴を探す
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; require で読み込まれたのに provide してない奴を探す | |
;;; .xyzzy の先頭に書いといて起動すると、provide しなかった奴が記録されるので | |
;;; *scratch* で (print-required-but-not-provided) するとてきとーに表示 | |
(defconstant +original-require+ #'require) | |
(defparameter *required-but-not-provided* nil) | |
(defun require (&rest args) | |
(let ((modules-prev (copy-list *modules*)) | |
(module-name (car args))) | |
(let ((result (apply +original-require+ args))) | |
(unless (modulep module-name) | |
(push (list module-name | |
(set-difference *modules* modules-prev) | |
(or (second args) | |
(find-load-path module-name))) | |
*required-but-not-provided*)) | |
result))) | |
(defun print-required-but-not-provided () | |
(format t #1="~:{~A~30T~A~60T~A~%~}" '((:modele :added :filename))) | |
(format t "------------------------------------------------------------------------------------------~%") | |
(format t #1# *required-but-not-provided*) | |
(values)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment