[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Documenting defstruct slots
Date: Sun, 8 Jan 1984 21:01 EST
From: PGS%MIT-OZ@MIT-MC.ARPA
I think that documenting the slots themselves, as opposed to documenting
anything that was generated automatically (especially the vanilla print
handler), is more like what one would want to do. The documentation strings
for slots could be printed by DESCRIBE, and the accessor could have a
documentation string created from the slot description. The documentation
string could be specified as a third object in each slot description:
(defstruct (elephant :conc-name)
(color 'GRAY
"The elephant's color, should be one of GRAY, BROWN, or PINK.")
...)
The documentation string for ELEPHANT-COLOR could look like:
"The accessor for the COLOR slot of the ELEPHANT structure.
The COLOR slot's documentation is:
The elephant's color, should be one of GRAY, BROWN, or PINK."
This is fine, but is not the syntax of Common Lisp defstruct. If you don't
have a copy of the Common Lisp manual (Mary Poppins edition) you should obtain
one.