unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: The doc-strings for car and cdr are insulting.
Date: Wed, 27 Oct 2004 18:35:43 -0500 (CDT)	[thread overview]
Message-ID: <200410272335.i9RNZh518737@raven.dms.auburn.edu> (raw)
In-Reply-To: <Pine.LNX.3.96.1041027183957.614A-100000@acm.acm> (message from Alan Mackenzie on Wed, 27 Oct 2004 18:56:22 +0000 (GMT))

Alan Mackenzie wrote:

   I was thinking that, although my proposed doc-strings are not the whole
   truth, they might be the clearest explanation for a raw beginner at lisp.

I do not exactly believe that reading docstrings is the best way for a
raw beginner at Lisp to start to learn Elisp.  Depending on the
person's inclination, he might either use the "Introduction to
Programming in Emacs Lisp" manual or the Elisp reference manual.  Both
are now included with the Emacs distribution.  I do not believe that
it makes a lot of sense to try to make docstrings play a role that
they quite simply can not play.

Docstrings for commands should contain notes about interactive usage
that are understandable by non-Elisp programmers, because they can be
consulted by Emacs users, but that is a different question.

I believe that it is perfectly all right for docstrings to assume a
certain minimum familiarity with Elisp, except for the description of
interactive usage of commands.

   However, the current (vacuous) definitions

They are not vacuous.  The _functions_ c[ad]r return the _objects_
c[ad]r, which is not the same thing.  It may be easy to guess the
purpose of the functions from the name, but it is not bad to make it
unambiguously clear anyway.  The reason somebody would do `C-h f
c[ad]r' is for the (non-trivial) details in the remainder of the
docstring, not to get a first introduction to Elisp.

   How about something like the following, changing "LIST" to "CONS",

That might indeed avoid some confusion (namely that the argument would
have to be a proper list).  Of course, the actual argument in the code
would need to be changed too, for consistency.

   Return the \"left hand side\" of CONS.

Your raw beginner would probably not know what a CONS is to begin
with.   I believe that the current version:  "Return the car of list."
is shorter and clearer.

Sincerely,

Luc.

  reply	other threads:[~2004-10-27 23:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1CMlLW-0000cN-HD@fencepost.gnu.org>
2004-10-27 18:56 ` The doc-strings for car and cdr are insulting Alan Mackenzie
2004-10-27 23:35   ` Luc Teirlinck [this message]
2004-10-27 23:40   ` Luc Teirlinck
2004-10-28 10:44   ` David Kastrup
2004-10-29  4:32   ` Richard Stallman
2004-10-29 10:12     ` Lennart Borgman
2004-10-29 15:32     ` Kevin Rodgers
2004-10-30  0:21       ` Chris Smith

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=200410272335.i9RNZh518737@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    --cc=emacs-devel@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.
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).