On Sat, Apr 27, 2024 at 1:35 PM Linas Vepstas <linasveps...@gmail.com> wrote:
> On Sat, Apr 27, 2024 at 2:47 AM Nikolaos Chatzikonstantinou 
> <nchatz...@gmail.com> wrote:
>>
>> On Fri, Apr 26, 2024 at 4:39 PM Tomas Volf <~@wolfsden.cz> wrote:
>> >
>> > What you want is:
>> >
>> >     (set-object-property! foo 'documentation "Contains a @code{'bar}.")
>>
>> Okay, so this can document objects. I propose that a good-enough
>> solution is to document symbols.
>
>
>  (define foo 42)
> (set-object-property! foo 'documentation "my foo thing")
> ,d foo
> my foo thing

You will also get the same response for
    ,d 42
because you've documented the value object and not the symbol object.
The function used by ,d is object-documentation by (ice-9
documentation). When procedures are documented via docstrings, the
documentation is set to the lambda itself (and as far as I can tell,
not via object properties.)

That's why I suggested that for variables, macros, etc, we can
document the symbol. However, I'm realizing there's another issue,
which has to do with module usage, i.e. symbols can be renamed. To
have consistent documentation follow the symbols around correctly, the
use-modules macro needs to be rewritten.

Regards,
Nikolaos Chatzikonstantinou

Reply via email to