Emacs lisp coding style: let forms
The let form (let ((var1 val1) (var2 val2) …) body)
is getting annoying.
Instead, now just declare var and set them all in the body.
This is simpler, more readible, and more flexible.
Its simpler and easier to read because you have all variable in one place.
Its more flexible because it avoids the let*
form variation that otherwise you need sometimes.
Also avoid the problem where some var is defined in the let while others must be in the body.
Now all in the body. Simple and uniform.
Actually, not sure.
The values form has one strong advantage: it better organize code, both semantic and syntax.
- it is better grouping of code by semantics, because all vars in the let* is about setting up vars. If you use separate setq, even though you may put them all together, but the let* form forces and guarantee the grouping.
- it is better grouping of code by syntax, because for each var there is a parenthesis. (this is better than if use one setq call with mulitple var/val pairs)