Zulip Chat Archive
Stream: general
Topic: Documentation strings
Joe Hendrix (Aug 06 2018 at 20:42):
Is there a convention in Lean for attaching documentation to specific declarations as in Haddock or Javadoc?
Reid Barton (Aug 06 2018 at 20:44):
Yes. use ---
or /-- ... -/
Joe Hendrix (Aug 06 2018 at 20:45):
Does that show up in the Emacs or VSCode interfaces? I'm using the emacs interface primarily.
Joe Hendrix (Aug 06 2018 at 20:47):
Surprisingly, I get an error command expected
when I use the /-- ... -/
syntax in front of a record field name. So it seems like there is some parsing.
Simon Hudon (Aug 06 2018 at 20:50):
In emacs, it should show you the doc string in the minibuffer.
Surprisingly, I get an error command expected when I use the /-- ... -/ syntax in front of a record field name.
I think they are only allowed on declarations (theorem
, def
, constant
, etc) and not on their components.
Joe Hendrix (Aug 06 2018 at 20:53):
Thanks! I see it now.
Mario Carneiro (Aug 06 2018 at 21:18):
for other places in a definition you should just use normal comments (--
or /- -/
), not doc comments
Last updated: Dec 20 2023 at 11:08 UTC