gists/gists/let-lambda.el

9 lines
303 B
EmacsLisp

;; https://stackoverflow.com/questions/36039840/elisp-bind-a-lambda-in-a-let-and-execute-it
(let ((f (lambda (s) (message s))))
;; f is a variable so should be treated as such.
(funcall f "This works.")
;; f is not a function so cannot be found if called like this.
(f "This does not work."))