(setf documentation) modifies docstrings of other functions

Bug #565737 reported by Stas Boukarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Committed
Low
Unassigned

Bug Description

(documentation 'sb-c::optional-dispatch-keyp 'function) returns "A place for clients to stash things."
but that docstring comes from src/code/run-program.lisp:

(setf (documentation 'process-status-hook 'function)
      "A function that is called when PROCESS changes its status.
The function is called with PROCESS as its only argument.")

Doing (require 'sb-concurrency) makes

(documentation 'sb-c::optional-dispatch-keyp 'function) => "Name of a MAILBOX. SETFable."

and sb-mailbox has (setf documentation) with that docstring.

As far as I can tell this only concerns functions generated by DEFSTRUCT.

Revision history for this message
Stas Boukarev (stassats) wrote :

I guess because these functions are implemented as closures over a structure, like the following:

(defun foo ()
  (lambda ()))

(defun test ()
  (setf (documentation (foo) 'function) "DOCSTRING")
  (documentation (foo) 'function))

(test) => "DOCSTRING"

Changed in sbcl:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

In 1.0.43.63.

Changed in sbcl:
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.