all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Use of "optional argument" in docstring
@ 2005-12-02 21:31 Bill Wohler
  2005-12-02 21:49 ` Nick Roberts
  2005-12-03 15:58 ` Richard M. Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Bill Wohler @ 2005-12-02 21:31 UTC (permalink / 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.

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

end of thread, other threads:[~2005-12-03 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-02 21:31 Use of "optional argument" in docstring Bill Wohler
2005-12-02 21:49 ` 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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.