Skip to content

method (setf documentation) should fail with non-standard doc-type

Assigning documentation with a non-standard doc-type symbol silently accepts the call, but doesn't seem to store the docstring anywhere useful.

> (setf (documentation 'groovy 'palette) "A fun one.")
;;; => "A fun one."
> (documentation 'groovy 'palette)
;;; => NIL

I would expect either an error in the setf or to get "A fun one." out of the documentation call. CLISP and Allegro are the only implementations where the example code works as I've described. SBCL fails with a useful error message on the setf.

     VERSION "24.5.10"
      VCS-ID "UNKNOWN"
          OS "Darwin"
  OS-VERSION "24.5.0"
MACHINE-TYPE "arm64"
    FEATURES (:WALKER :CDR-6 :GRAY-STREAMS-MODULE :CDR-1 :CDR-5 :DARWIN
              :FORMATTER :CDR-7 :ECL-WEAK-HASH :LITTLE-ENDIAN
              :ECL-READ-WRITE-LOCK :LONG-LONG :UINT64-T :UINT32-T :UINT16-T
              :COMPLEX-FLOAT :LONG-FLOAT :UNICODE :DFFI :CLOS-STREAMS
              :CMU-FORMAT :UNIX :ECL-PDE :DLOPEN :CLOS :THREADS :BOEHM-GC
              :ANSI-CL :COMMON-LISP :FLOATING-POINT-EXCEPTIONS
              :IEEE-FLOATING-POINT :PACKAGE-LOCAL-NICKNAMES :CDR-14
              :PREFIXED-API :FFI :AARCH64 :COMMON :ECL)
Edited by wmannis