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

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

Re: Always using let*


From: Stefan Monnier
Subject: Re: Always using let*
Date: Tue, 16 Sep 2014 16:49:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> But, quite often, I have several independent variable, except one or two.
> So, I would use "let" rather than "let*", but don't bind these variables 
> and then use "setq" in the body of the let:
> (let ((a (val-for-a))
>       (b (val-for-b))
>       ...
>       x y) ; depend on a b
>    (setq x (val-for-x a b))
>    (setq y (val-for-y a b))
>    ...

In some cases, `setq' can't be easily avoided, but otherwise, I strongly
recommend let* over let+setq.

If it depended on me, I'd swap the two since in most cases you could use
let*, it's very rare to really need `let'.


        Stefan




reply via email to

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