GNU bug report logs -
#19371
25.0.50; doc of functions and macros defined in macroexp.el
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Sat, 13 Dec 2014 19:06:02 UTC
Severity: minor
Tags: fixed
Found in version 25.0.50
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> Lars Ingebrigtsen <larsi <at> 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
This bug report was last modified 5 years and 294 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.