docstrings for functions in :final deprecation stage are bogus
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Example:
(define-
(define-
(documentation 'dont-use-this 'function) =>
"SB-IMPL:
Use SB-IMPL:
The root cause is that attaching documentation to closures affects the underlying simple-fun.
There is simply no place to store the documentation in a closure.
There are three solutions to this problem for deprecation, not the general limitation.
1) Store the documentation in globaldb keyed by the name of the closure.
Now that we have re-nameable closures, this is a cinch. (And again, re-naming is not something to be exposed to users - it works just well enough to do some nice system-internal things, because it changes the identity of the closure, which is undesirable)
2) don't try to use closures to reduce storage size. Just use DEFUN.
3) use a hashtable keyed by the closure. For the more general case this should be a weak hashtable.
It seems to me that (1) is most appropriate here.
Changed in sbcl: | |
status: | New → Fix Released |
On Wed, 2015-04-01 at 11:55 +0000, Douglas Katzman wrote:
> 1) Store the documentation in globaldb keyed by the name of the closure.
> Now that we have re-nameable closures, this is a cinch. (And again, re-naming is not something to be exposed to users - it works just well enough to do some nice system-internal things, because it changes the identity of the closure, which is undesirable)
>
> 2) don't try to use closures to reduce storage size. Just use DEFUN.
>
> 3) use a hashtable keyed by the closure. For the more general case this
> should be a weak hashtable.
>
> It seems to me that (1) is most appropriate here.
I'm in favor of something like (1). I would like to store the actual {VARIABLE, FUNCTION} -INFORMATION to sbcl-devel (attached here function} :deprecated NAME) would be a structure
deprecation information for functions in globaldb (as is already done
for variables). I previously sent a draft patch for doing that and
making deprecation information available to users via
SB-CLTL2:
for convenience). Ideally the type of
(info :{variable,
containing state, since and replacements instead of the current list.
This solution would require/allow handling deprecated functions in ir1
conversion and would free us (I think) from the difficulties of the
current :LATE deprecation implementation for functions.
What do you think?