Previous: , Up: Coding Style   [Contents][Index]


A.1.2 Docstrings

Declt tries to make the generated output look nicer in various ways. For example, setf functions are documented right after the corresponding reader (if any) instead of being listed under the “S” letter. In a similar vein, methods are documented as components of their respective generic function, not as toplevel definitions (except for foreign methods without a corresponding generic function definition).

One thing that you can influence is Declt’s attempt at merging definitions. Merging may occur when there are definitions for both symbol and (setf symbol). This happens for accessor functions, generic functions or setf expanders. This also happens for accessor methods. If possible, Declt will try to generate a single definition for both the reader and the writer. That is only possible, however, if both definitions would render the same documentation, i.e. same package, source file and docstring.

If you don’t provide a docstring, merging will work. If you provide different docstrings (like “Set the value of …” and “Get the value of …”), you will effectively prevent merging from happening. One thing I like to do is to provide the same neutral docstring for readers and writers. For instance “Access the value of …”. This way, definitions can both provide a docstring and be merged together.