Skip to content

Commit 6e138fb

Browse files
author
Mark Evenson
committed
Document the APROPOS and APROPOS-LIST extension to ANSI
CLHS defines APROPOS and APROPOS-LIST with the lambda-list (string-designator &optional package-designator) ABCL extends ANSI by adding a third EXTERNAL-ONLY parameter to list only external symbols. (string-designator &optional package-designator external-only)
1 parent 99ed846 commit 6e138fb

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

src/org/armedbear/lisp/apropos.lisp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,16 @@
3434
(in-package #:system)
3535

3636

37-
(defun apropos-list (string-designator &optional package-designator
38-
external-only)
37+
(defun apropos-list (string-designator
38+
&optional package-designator external-only)
39+
"Return the list of all symbols matching STRING-DESIGNATOR
40+
41+
If the optional PACKAGE-DESIGNATOR is specified, restrict the match to
42+
symbols within the designated package.
43+
44+
As an extension to ANSI, an optional true generalized boolean
45+
EXTERNAL-ONLY further restricts the results to symbols which are
46+
external to the package matching PACKAGE-DESIGNATOR."
3947
(if package-designator
4048
(let ((package (find-package package-designator))
4149
(string (string string-designator))
@@ -54,10 +62,20 @@
5462
(apropos-list string-designator package external-only))
5563
(list-all-packages))))
5664

57-
(defun apropos (string-designator &optional package-designator external-only)
58-
(dolist (symbol (remove-duplicates (apropos-list string-designator
59-
package-designator
60-
external-only)))
65+
(defun apropos (string-designator
66+
&optional package-designator external-only)
67+
"Print the name of all symbols matching STRING-DESIGNATOR to the standard output
68+
69+
If the optional PACKAGE-DESIGNATOR is specified, restrict the match to
70+
symbols within the designated package.
71+
72+
As an extension to ANSI, an optional true generalized boolean
73+
EXTERNAL-ONLY further restricts the results to symbols which are
74+
external to the package matching PACKAGE-DESIGNATOR."
75+
76+
(dolist (symbol (remove-duplicates (%apropos-list string-designator
77+
package-designator
78+
nil)))
6179
(fresh-line)
6280
(prin1 symbol)
6381
(when (boundp symbol)

0 commit comments

Comments
 (0)