[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lexical let and setq
From: |
Lars Magne Ingebrigtsen |
Subject: |
Re: Lexical let and setq |
Date: |
Sat, 14 Sep 2013 13:13:32 +0200 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> That one is OK, since recursion is not supported efficiently.
> The problem is when people use the above because they're writing (poor)
> C code in Elisp (e.g. they begin their functions with a big let
> declaring all the local vars that they may use later on in the
> function).
I think the most common reason for stashing a lot of variables in a let
is to avoid infinite indentation.
(let ((a (foo)))
(something)
(let ((b (something-else)))
(more a b)
(let ((c (yet-more)))
(zot a b c))))
vs
(let ((a (foo))
b c)
(something)
(setq b (something-else))
(more a b)
(setq c (yet-more))
(zot a b c))
I kinda think the latter form is sometimes more readable.
--
(domestic pets only, the antidote for overdose, milk.)
address@hidden * Lars Magne Ingebrigtsen