unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <14278@debbugs.gnu.org>
Subject: bug#14278: 24.3.50; doc of `defstruct'
Date: Fri, 26 Apr 2013 13:29:31 -0700	[thread overview]
Message-ID: <66929FFAEED944A9872AEF400BED6815@us.oracle.com> (raw)
In-Reply-To: <F911DA44B9AD4997A5F7BA84F426967E@us.oracle.com>

> Both the doc string and (cl) `Structures' are a bit sloppy in their
> descriptions.  SLOTS is the name of one parameter.  It is incorrect to
> speak of SLOT unless that has been defined as one of the elements of
> list SLOTS.  And it needs in fact to be said that SLOTS is a list.
>  
> The doc string says "Each SLOT may instead..." - instead of what?  It
> forgets to say that a slot can be a symbol.

Things are worse than that, in fact.

1. The manual says that each element of SLOT, if not a symbol, is a list
(SLOT-NAME DEFAULT-VALUE SLOT-OPTIONS...).  But the doc string says it is (SLOT
SLOT-OPTS...), forgetting DEFAULT-VALUE altogether.

2. The manual does not say what each element of SLOT-OPTIONS is.  The doc string
at least says that SLOT-OPTS is a list of key value pairs.  Both manual and doc
string would be better off saying that SLOT-OPT[ION]S is a plist, and describe
what the keys and values of the plist can be.

3. The same problems reported originally for SLOTS exist also for NAME.  It
speaks of OPTION without giving that term any relation to OPTIONS.

4. The doc string does not say that NAME can be a symbol.  The manual says that
NAME can be a list of a symbol followed by "struct options" (it should
presumably say "structure options", since that is the term used elsewhere in the
node).

But the manual does not say that a structure option here is either a KEYWORD or
a pair (KEYWORD VALUE).  In this case the doc string is more complete (assuming
it is correct here) - the manual provides no help with this.

5. It is misleading and confusing to write "NAME may instead take the form (NAME
OPTIONS...)".  That sounds like a recursive definition, allowing for, say, NAME
to be (foo (foo (foo ...) bar))).  Use two different names: NAME and NAME1 or
something, else it is impossible to know when you are referring to the parameter
and when you are referring to one of its parts.






  reply	other threads:[~2013-04-26 20:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-26 20:00 bug#14278: 24.3.50; doc of `defstruct' Drew Adams
2013-04-26 20:29 ` Drew Adams [this message]
2013-04-26 21:02   ` Drew Adams
2013-04-26 21:13     ` Drew Adams
2021-08-21 14:50 ` Lars Ingebrigtsen

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=66929FFAEED944A9872AEF400BED6815@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=14278@debbugs.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).