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

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

Re: [External] : `let' vs `let*'


From: Stefan Monnier
Subject: Re: [External] : `let' vs `let*'
Date: Tue, 15 Mar 2022 18:40:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>   (setq a 42)
>   (setq b 43)
>   (let ((a b)
>         (b a))
>     (list a b))
>
>   => (43 42)

While you can come up with such examples, they tend to always
be contrived.  In my experience, the benefit of `let` is only really
seen in macros, where you can do:

    `(let ((x ,arg1)
           (y ,arg2)
           (f (lambda (,z) ,@body)))
       ...)

without fear of capturing an `x` that might occur inside `arg2` or `body`.
In hand-written code, having only `let*` and no `let` would make almost
no difference.


        Stefan




reply via email to

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