unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: 19371@debbugs.gnu.org
Subject: bug#19371: 25.0.50; doc of functions and macros defined in macroexp.el
Date: Fri, 02 Aug 2019 23:10:43 +0200	[thread overview]
Message-ID: <87v9vfl1d8.fsf@mouse.gnus.org> (raw)
In-Reply-To: <1b8c129f-19cb-4088-ad8a-4eb0f9df6a54@default> (Drew Adams's message of "Sat, 13 Dec 2014 11:04:24 -0800 (PST)")

Drew Adams <drew.adams@oracle.com> writes:

> 1. `macroexp-let2' is used plenty in the Lisp sources now.  And its
> documentation is in complete/rudimentary.  Please fix this.

Looks like Paul added extensive documentation to this macro i 2015.

> 2. And then there is `macroexp-let2*', whose doc string says only to
> bind each binding (bind a binding?!) "as `macrolet2' does".  That
> means nothing.  Presumably, based on the `*' in the name, the behavior
> is similar to that of `let*'.  If so, you can use the doc of `let*
> as inspiration.

Uhm...  I have no idea what it does:

(defmacro macroexp-let2* (test bindings &rest body)
  "Bind each binding in BINDINGS as `macroexp-let2' does."
  (declare (indent 2) (debug (sexp (&rest (sexp form)) body)))
  (pcase-exhaustive bindings
    ('nil (macroexp-progn body))
    (`((,var ,exp) . ,tl)
     `(macroexp-let2 ,test ,var ,exp
        (macroexp-let2* ,test ,tl ,@body)))))

Perhaps somebody could use their decoder ring.

> 3. The doc strings of `macroexp-let*', `macroexp-progn', and others
> say that the function returns "an expression equivalent to" some
> expression.  They should say what they mean by equivalence, here.
> If you mean that they use `macroexp-quote' to create the
> "equivalent" expression then say so.

No, the meaning here seems to be that they are semantically equivalent.
I changed the doc string of macroexp-progn to 

  "Return EXPS with `progn' prepended.
If EXPS is a single expression, `progn' is not prepended."

but I think the rest are OK.

> The doc string of `macroexp-let*' needs to use BINDINGS and EXP, not
> the same in lowercase, in the equivalent expression.

I've now fixed this.

> Similarly, the doc string of `macroexp-if' needs to use uppercase
> TEST, THEN, and ELSE.

Somebody else has fixed that in the intervening years.

> 4. The doc string of `macroexp--accumulate' refers to parameters
> that do not exist: VAR and LIST.  It should say explicitly (and
> not just via `(fn ...)') that the first parameter is a list of
> the form `(VAR LIST)'.  (And no, it does not matter that this
> macro is internal.)

This has been fixed, too.

> 5. The doc string of `macroexp--cons' is incomprehensible.

I've now fixed it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2019-08-02 21:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-13 19:04 bug#19371: 25.0.50; doc of functions and macros defined in macroexp.el Drew Adams
2019-08-02 21:10 ` Lars Ingebrigtsen [this message]
2019-08-02 22:33   ` Michael Heerdegen
2019-08-03 11:50     ` Lars Ingebrigtsen
2019-08-04 12:29       ` Michael Heerdegen
2019-08-04 12:44         ` 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=87v9vfl1d8.fsf@mouse.gnus.org \
    --to=larsi@gnus.org \
    --cc=19371@debbugs.gnu.org \
    --cc=drew.adams@oracle.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).