unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* How to write documentation comments for procedures?
@ 2018-08-05 13:27 Zelphir Kaltstahl
  2018-08-05 16:22 ` tomas
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Zelphir Kaltstahl @ 2018-08-05 13:27 UTC (permalink / raw)
  To: guile-user

Hello Guile user list members,

How do you write documentation strings for procedures? What are the
conventions for describing arguments?

Since only the last expression is returned from a procedure, one can use
normal strings as a first thing in a procedure as follows:

(define (proc a b c)
  "comment here"
  (+ a b c))

However, when I have a longer explanation for a procedure, longer than a
single line of certain length, then the line will softly wrap in editors
and the explanation will continue on the next line at the beginning
usually. Also it will be a very long line, longer than most conventions
for line lengths. For example:

(define (proc a b c)
  "comment here comment here comment here comment here comment here
comment here comment here comment here comment here comment here comment
here comment here comment here ..."
  (+ a b c))

So I could make it multiple strings instead:

(define (proc a b c)
  "comment here comment here comment here"
  "comment here comment here comment here"
  "comment here comment here comment here"
  "comment here comment here ..."
  (+ a b c))

Would that work for tools, which look at code and produce documentation
websites though? Would they be aware of multiple strings being the doc
comment?

I could also go for normal comments using ;; or even #||# regions, but
the same questions arises again: What would tools make of this? Would
they recognize it as doc comments?

How do you handle this? And what tools are there to generate
documentation websites or PDF or things like that?

Regards,

Zelphir




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-08-21 21:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-05 13:27 How to write documentation comments for procedures? Zelphir Kaltstahl
2018-08-05 16:22 ` tomas
2018-08-06  9:26 ` Arun Isaac
     [not found] ` <c4921326.AM0AABISyFkAAAAAAAAAAARRGgcAAAACwQwAAAAAAAW9WABbaBRO@mailjet.com>
2018-08-06 22:58   ` Zelphir Kaltstahl
2018-08-07  5:58     ` Arun Isaac
2018-08-21 21:41       ` Arne Babenhauserheide

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).