APROPOS with a package argument only finds present symbols, not accessible symbols
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The standard says this regarding APROPOS:
If package is non-nil, only the symbols accessible in that package
are searched; otherwise all symbols accessible in any package are
searched.
However, when providing a package argument to APROPOS in SBCL, it only prints symbols that are present in the given package, not symbols that are accessible.
Example:
CL-USER> (defvar *buggalo-package* (make-package "BUGGALO" :use nil))
*BUGGALO-
CL-USER> (defvar *buggalo-symbol* (intern "BUGGALO" *buggalo-package*))
*BUGGALO-
CL-USER> (export (list *buggalo-symbol*) *buggalo-package*)
T
CL-USER> (defvar *inherits-buggalo* (make-package "BUGGALO-INHERITED"
:use (list *buggalo-
*INHERITS-
CL-USER> (apropos "BUGGALO" *buggalo-package*)
BUGGALO:BUGGALO
; No value
CL-USER> (apropos "BUGGALO" *inherits-buggalo*)
; No value
For the last command, I expected to see "BUGGALO:BUGGALO" printed. That is what is suggested by the standard and that is what happens with other implementations I tried (CLISP and CCL).
I'm using the latest SBCL.
Changed in sbcl: | |
status: | New → Fix Committed |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
This seems potentially easy to fix, but I'm not sure what the non-standard EXTERNAL-ONLY semantics are. Does it mean "Only return symbols that are external in the provided package"? If so, I think the attached patch does the trick.