Emacs lisp coding style: let forms

By Xah Lee. Date: .

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.

elisp coding style let forms 2021-07-04
emacs lisp coding style, let forms. Before and After.

Actually, not sure.

The values form has one strong advantage: it better organize code, both semantic and syntax.

Emacs Lisp Misc Essays