mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-15 05:43:19 -08:00
APROPOS-LIST no longer returns duplicate symbols
This commit is contained in:
parent
1d3355d0db
commit
896e1e3ff1
2 changed files with 10 additions and 2 deletions
|
|
@ -56,6 +56,8 @@ ECL 12.2.2:
|
|||
etc, which correspond to the POSIX C constants INT_MAX, INT_MIN, LONG_MAX,
|
||||
and similar ones.
|
||||
|
||||
- APROPOS-LIST no longer returns duplicate symbols.
|
||||
|
||||
* Windows:
|
||||
|
||||
- ECL guesses whether the input / output / error streams are consoles. If
|
||||
|
|
|
|||
|
|
@ -156,16 +156,22 @@ PACKAGE is non-NIL, then only the specified PACKAGE is searched."
|
|||
(mapc #'print-symbol-apropos (apropos-list string package))
|
||||
(values))
|
||||
|
||||
|
||||
(defun apropos-list (string &optional package)
|
||||
"Args: (string &optional (package nil))
|
||||
Returns a list of all symbols whose print-names contain STRING as substring.
|
||||
If PACKAGE is non-NIL, then only the specified PACKAGE is searched."
|
||||
(sort (delete-duplicates (apropos-list-inner string package))
|
||||
#'(lambda (s1 s2)
|
||||
(string-lessp (prin1-to-string s1)
|
||||
(prin1-to-string s2)))))
|
||||
|
||||
(defun apropos-list-inner (string package)
|
||||
(declare (si::c-local))
|
||||
(let* ((list '())
|
||||
(string (string string)))
|
||||
(cond (package
|
||||
(dolist (p (package-use-list package))
|
||||
(setf list (nconc (apropos-list string p) list)))
|
||||
(setf list (nconc (apropos-list-inner string p) list)))
|
||||
(do-symbols (symbol package)
|
||||
(when (search string (string symbol) :test #'char-equal)
|
||||
(setq list (cons symbol list)))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue