bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22192: Doc string of macroexp-let2 is obscure.


From: Alan Mackenzie
Subject: bug#22192: Doc string of macroexp-let2 is obscure.
Date: Thu, 17 Dec 2015 10:09:36 +0000
User-agent: Mutt/1.5.23 (2014-03-12)

Hello, Emacs.

The complete doc string of macroexp-let2 is

    "Bind VAR to a copyable expression that returns the value of EXP.
    This is like `(let ((v ,EXP)) ,EXPS) except that `v' is a new generated
    symbol which EXPS can find in VAR.
    TEST should be the name of a predicate on EXP checking whether the `let' can
    be skipped; if nil, as is usual, `macroexp-const-p' is used."

This macro is widely used (over 50 times) in Emacs, and is not
documented in the Elisp manual.  The doc string is difficult to
understand.

What is "Bind VAR to a copyable expression that returns the value of
EXP." supposed to mean?  What is a "copyable expression"?  Surely all
expressions can be copied?

How does this expression "return the value of EXP"?  Surely functions
return values, not expressions?

What is the "value of EXP" that is being returned?  Does "value of EXP"
just mean "EXP", here?  What is the purpose of it being returned?

"This is like `(let ((v ,EXP)) ,EXPS)' except that `v' is a new
generated symbol which EXPS can find in VAR.": The first part of this
sentence is quite clear, but "which ,EXPS can find in VAR." is puzzling.
How, precisely, do the ,EXPS "find" v in VAR?

"TEST should be the name of a predicate on EXP checking whether the
`let' can be skipped ...": why "the name of a predicate", and not simply
"a predicate"?  Surely the presence of this test makes a word like
"maybe" necessary in the first line of the doc string?

What happens to the generated code when "the `let' is skipped"?  In this
case, can v, or VAR, still be used by the ,EXPS?

Above all, what is the purpose of this macro?  What does it achieve?

-- 
Alan Mackenzie (Nuremberg, Germany).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]