Created
June 26, 2020 12:34
-
-
Save death/ba3220de533f5ccd2f64e246116d61bb to your computer and use it in GitHub Desktop.
Find suspect symbols
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
(defun find-suspect-symbols (packages) | |
"Return a list of lists of suspect symbols present in PACKAGES. | |
A suspect symbol is a symbol that has a name that is equal to another | |
symbol in another package." | |
(let ((symbols-by-names (make-hash-table :test 'equal))) | |
(flet ((add-package (package) | |
(do-symbols (symbol package) | |
(pushnew symbol (gethash (symbol-name symbol) symbols-by-names '()))))) | |
(dolist (package packages) | |
(add-package package)) | |
(loop for symbols being each hash-value of symbols-by-names | |
when (cdr symbols) | |
collect symbols)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment