[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Always using let*
From: |
Drew Adams |
Subject: |
RE: Always using let* |
Date: |
Sun, 14 Sep 2014 14:25:30 -0700 (PDT) |
> Would it be OK to always use let*? I was just bitten by the fact
> that with let you can not previous variables from the let statement,
> as is possible with setq. So I am thinking about always using let*,
> so I do not have to think about it. Or are there good reasons to use
> let when you do not need let*?
The most common reason is when you want to use a variable value
in the cadr of a binding and you do *not* want to pick up the
variable's newly bound value. IOW, precisely the opposite use
case of what you wanted when you were bit.
(setq c 3)
(let ((c (+ c 4))
(b (* c 42))) ; Use original C value: 3
...)
(The other reason is that for some Lisps the bindings of `let'
can be done in parallel, which can be quicker.)
- Always using let*, Cecil Westerhof, 2014/09/14
- RE: Always using let*,
Drew Adams <=
- RE: Always using let*, Drew Adams, 2014/09/15
- Message not available
- Re: Always using let*, Cecil Westerhof, 2014/09/15
- Re: Always using let*, Emanuel Berg, 2014/09/15
- Re: Always using let*, Cecil Westerhof, 2014/09/16
- Re: Always using let*, Emanuel Berg, 2014/09/16
- Re: Always using let*, Cecil Westerhof, 2014/09/18
- Re: Always using let*, Emanuel Berg, 2014/09/18
Message not available