mgl-pax
mgl-pax copied to clipboard
slot's using default generic functions
It would be great if slot's using default generic functions would pull documentation from the slot definition when listed as generic-function in the defsection.
So the problem is that when using the generic-function
locative instead of e.g. reader
the docstring is not found.
(defclass xxx ()
((a :reader xxx-a :documentation "This is XXX-A.")))
(pax:document (pax:locate 'xxx-a '(pax:reader xxx)))
.. - [reader] XXX-A XXX
..
.. This is XXX-A.
..
(pax:document (pax:locate 'xxx-a 'generic-function))
.. - [generic-function] XXX-A OBJECT
..
I guess you consider the choice between having a reader or a separate generic function an implementation detail and would not like to expose readerness in the documentation, right?
Whoops, I meant to use the method
locative.
(pax:document (pax:locate 'xxx-a '(method () (xxx))))
.. - [method] XXX-A (XXX XXX)
..
.. This is XXX-A.
..
It seems to work as intended. The problem with using generic-function
is that there can be multiple classes, each with its own reader (with the same name), so there is no single docstring which shall be presented.
Closing. Feel free to reopen if my reasoning above is incorrect.