(defun list-all-packages ()
#!+sb-doc
- "Returns a list of all existing packages."
+ "Return a list of all existing packages."
(let ((res ()))
- (maphash #'(lambda (k v)
- (declare (ignore k))
- (pushnew v res))
+ (maphash (lambda (k v)
+ (declare (ignore k))
+ (pushnew v res))
*package-names*)
res))
\f
(defun intern (name &optional (package (sane-package)))
#!+sb-doc
- "Returns a symbol having the specified name, creating it if necessary."
+ "Return a symbol having the specified name, creating it if necessary."
;; We just simple-stringify the name and call INTERN*, where the real
;; logic is.
(let ((name (if (simple-string-p name)
(defun find-symbol (name &optional (package (sane-package)))
#!+sb-doc
- "Returns the symbol named String in Package. If such a symbol is found
+ "Return the symbol named String in Package. If such a symbol is found
then the second value is :internal, :external or :inherited to indicate
how the symbol is accessible. If no symbol is found then both values
are NIL."
(defun unuse-package (packages-to-unuse &optional (package (sane-package)))
#!+sb-doc
- "Remove Packages-To-Unuse from the use list for Package."
+ "Remove PACKAGES-TO-UNUSE from the USE list for PACKAGE."
(let ((package (find-undeleted-package-or-lose package)))
(dolist (p (package-listify packages-to-unuse))
(setf (package-%use-list package)
"Return a list of all symbols in the system having the specified name."
(let ((string (string string-or-symbol))
(res ()))
- (maphash #'(lambda (k v)
- (declare (ignore k))
- (multiple-value-bind (s w) (find-symbol string v)
- (when w (pushnew s res))))
+ (maphash (lambda (k v)
+ (declare (ignore k))
+ (multiple-value-bind (s w) (find-symbol string v)
+ (when w (pushnew s res))))
*package-names*)
res))
\f
;;;; APROPOS and APROPOS-LIST
-;;; KLUDGE: All the APROPOS stuff should probably be byte-compiled, since it's
-;;; only likely to be used interactively. -- WHN 19990827
-
(defun briefly-describe-symbol (symbol)
(fresh-line)
(prin1 symbol)
(when (fboundp symbol)
(write-string " (fbound)")))
-(defun apropos-list (string-designator &optional package external-only)
+(defun apropos-list (string-designator
+ &optional
+ package-designator
+ external-only)
#!+sb-doc
"Like APROPOS, except that it returns a list of the symbols found instead
of describing them."
- (if package
- (let ((string (stringify-name string-designator "APROPOS search"))
- (result nil))
- (do-symbols (symbol package)
- (when (and (eq (symbol-package symbol) package)
- (or (not external-only)
- (eq (find-symbol (symbol-name symbol) package)
- :external))
- (search string (symbol-name symbol) :test #'char-equal))
- (push symbol result)))
- result)
- (mapcan (lambda (package)
- (apropos-list string-designator package external-only))
- (list-all-packages))))
+ (if package-designator
+ (let ((package (find-undeleted-package-or-lose package-designator))
+ (string (stringify-name string-designator "APROPOS search"))
+ (result nil))
+ (do-symbols (symbol package)
+ (when (and (eq (symbol-package symbol) package)
+ (or (not external-only)
+ (eq (find-symbol (symbol-name symbol) package)
+ :external))
+ (search string (symbol-name symbol) :test #'char-equal))
+ (push symbol result)))
+ result)
+ (mapcan (lambda (package)
+ (apropos-list string-designator package external-only))
+ (list-all-packages))))
(defun apropos (string-designator &optional package external-only)
#!+sb-doc