From: Olof-Joachim Frahm Date: Thu, 29 Aug 2013 13:21:08 +0000 (+0200) Subject: Add EXTERNAL-ONLY to FIND-ALL-SYMBOLS. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=7ab9118b4ef7b651cd9f7331a5265965df3f9d82;p=sbcl.git Add EXTERNAL-ONLY to FIND-ALL-SYMBOLS. --- 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))