+2014-12-18 Artur Malabarba <bruce.connor.am@gmail.com>
+
+ * let-alist.el (let-alist): Evaluate the `alist' argument only
+ once.
+
2014-12-18 Sam Steingold <sds@gnu.org>
* emacs-lisp/package.el: Avoid compilation warning by declaring
.body
.site))"
(declare (indent 1) (debug t))
- `(let ,(mapcar (lambda (x) `(,(car x) (cdr (assq ',(cdr x) ,alist))))
- (delete-dups (let-alist--deep-dot-search body)))
- ,@body))
+ (let ((var (gensym "let-alist")))
+ `(let ((,var ,alist)
+ (let ,(mapcar (lambda (x) `(,(car x) (cdr (assq ',(cdr x) ,var))))
+ (delete-dups (let-alist--deep-dot-search body)))
+ ,@body)))))
(provide 'let-alist)