How do I do closures in Emacs Lisp?

Found another solution with lexical-let

(defun foo (n) 
    (lexical-let ((n n)) #'(lambda() n)))

(funcall (foo 10)) ;; => 10

Leave a Comment