From 7ab9118b4ef7b651cd9f7331a5265965df3f9d82 Mon Sep 17 00:00:00 2001 From: Olof-Joachim Frahm Date: Thu, 29 Aug 2013 15:21:08 +0200 Subject: [PATCH] Add EXTERNAL-ONLY to FIND-ALL-SYMBOLS. --- src/code/target-package.lisp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/code/target-package.lisp b/src/code/target-package.lisp index 7a06e73..c08de7c 100644 --- a/src/code/target-package.lisp +++ b/src/code/target-package.lisp @@ -1534,16 +1534,18 @@ PACKAGE." (remove package (the list (package-%used-by-list p)))))) t))) -(defun find-all-symbols (string-or-symbol) +(defun find-all-symbols (string-or-symbol &optional external-only) #!+sb-doc - "Return a list of all symbols in the system having the specified name." + "Return a list of all symbols in the system having the specified name. If +EXTERNAL-ONLY then only return external symbols." (let ((string (string string-or-symbol)) (res ())) (with-package-names (names) (maphash (lambda (k v) (declare (ignore k)) (multiple-value-bind (s w) (find-symbol string v) - (when w (pushnew s res)))) + (when (if external-only (eq w :external) w) + (pushnew s res)))) names)) res)) -- 1.7.10.4