From: Lars Ingebrigtsen <larsi@gnus.org>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 19371@debbugs.gnu.org
Subject: bug#19371: 25.0.50; doc of functions and macros defined in macroexp.el
Date: Sat, 03 Aug 2019 13:50:27 +0200 [thread overview]
Message-ID: <871ry2lb7g.fsf@mouse.gnus.org> (raw)
In-Reply-To: <87blx7jiz9.fsf@web.de> (Michael Heerdegen's message of "Sat, 03 Aug 2019 00:33:14 +0200")
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> (defun macroexp-progn (exps)
>> - "Return an expression equivalent to \\=`(progn ,@EXPS)."
>> + "Return EXPS with `progn' prepended.
>> +If EXPS is a single expression, `progn' is not prepended."
>> (if (cdr exps) `(progn ,@exps) (car exps)))
>
> That's described a bit confusingly: AFAIU EXPS should always be a list
> of expressions, and when it's _a_list_ of only one expression, `progn'
> is not prepended and the expression is returned (and not EXPS as your
> text suggests). BTW, compared to that description I find the original
> version much better (simpler).
Yeah, the doc string is now misleading. I've rewritten it now as:
---
Return EXPS (a list of expressions) with `progn' prepended.
If EXPS is a list with a single expression, `progn' is not
prepended, but that expression is returned instead.
---
>> 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)))))
>
> You understand what macroexp-let2 does?
No, not really.
> It supports one binding (a var plus an expression, specified as
> separate arguments). macroexp-let2* supports a list of such pairs
> specified as BINDINGS, similar to let*.
>
> The naming scheme `macroexp-let2' vs. `macroexp-let2*' is not ideal:
> first, because `macroexp-let2' doesn't support multiple bindings like
> `let', and secondly because, if I look at the use cases in the sources,
> most of them just want to establish multiple bindings, but parallel
> binding would suffice, so they actually want to non-stared version of
> macroexp-let2*, which is not macroexp-let2 - AFAICT it doesn't exist.
Yes, it's confusing. But perhaps you could propose a doc string for
`macroexp-let2*'? :-)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
next prev parent reply other threads:[~2019-08-03 11:50 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
2019-08-02 22:33 ` Michael Heerdegen
2019-08-03 11:50 ` Lars Ingebrigtsen [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871ry2lb7g.fsf@mouse.gnus.org \
--to=larsi@gnus.org \
--cc=19371@debbugs.gnu.org \
--cc=michael_heerdegen@web.de \
/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 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.