unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@gmail.com>
To: guile-user@gnu.org
Subject: How to write documentation comments for procedures?
Date: Sun, 5 Aug 2018 15:27:33 +0200	[thread overview]
Message-ID: <31082a15-b9f4-aba2-6a2b-2e784cf55406@gmail.com> (raw)

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




             reply	other threads:[~2018-08-05 13:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-05 13:27 Zelphir Kaltstahl [this message]
2018-08-05 16:22 ` How to write documentation comments for procedures? 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31082a15-b9f4-aba2-6a2b-2e784cf55406@gmail.com \
    --to=zelphirkaltstahl@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).