unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Bill Wohler <wohler@newt.com>
Subject: Use of "optional argument" in docstring
Date: Fri, 02 Dec 2005 13:31:38 -0800	[thread overview]
Message-ID: <22334.1133559098@olgas.newt.com> (raw)

Is there a convention regarding the use of explicitly using the word
"optional" when describing an optional argument in the docstring?

For example:

  (log arg &optional base)

  Return the natural logarithm of ARG.
  If second optional argument BASE is given, return log arg using that base.
            ^^^^^^^^

I didn't see one in "Documentation Tips" and a brief survey of the code
shows that folks go either way.

It seems redundant to me since the text "&optional" appears in the
function's spec in the *Help* buffer. However, I'd prefer to go with the
flow (if I knew what it was).

I also think the documentation often reads better if the number and the
word "argument" is dropped. For example, in the example above, "If BASE
is given..." 

-- 
Bill Wohler <wohler@newt.com>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.

             reply	other threads:[~2005-12-02 21:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-02 21:31 Bill Wohler [this message]
2005-12-02 21:49 ` Use of "optional argument" in docstring Nick Roberts
2005-12-02 21:55   ` Lennart Borgman
2005-12-02 22:25   ` Bill Wohler
2005-12-02 22:43     ` Nick Roberts
2005-12-03 15:58 ` Richard M. Stallman

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/emacs/

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

  git send-email \
    --in-reply-to=22334.1133559098@olgas.newt.com \
    --to=wohler@newt.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).