[Top][All Lists]

[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 15:56:19 -0700 (PDT)

> > (let ((c  (+ c 4))
> >       (b  (* c 42))) ; Use original C value: 3
> > ...)
> That makes my head spin. ;-)

Does this make it easier for you?

(let ((c  5)
      (b  c))   ; Use value of the `c' that is bound outside.

And remember that the local binding of `c' to 5 can bind an
existing dynamic variable (from, say, `(defvar c 3 "C doc")')
for the duration of this `let'.  Or it can bind an existing
lexically scoped variable `c' from an outer `let' for the scope
(or for the duration, if `lexical-binding'=`nil') of this inner
`let'.  Or it can create and bind a new variable.

This answers the question of why you might not use a different
name from `c': because you want to bind an existing variable
named `c'.

reply via email to

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