bram85's Blog

bram85's Avatar Image
Tooting mostly about #emacs.
← All posts

#til (or rather, Today I Realized) that in #elisp, you cannot call a variable with a lambda function in a let expression:

(let ((f (lambda (s) (message s))))
  (funcall f "This works.")

  (f "This does not work."))

This is because function names and variable names live in separate namespaces in Emacs Lisp and Common #Lisp.

Also explained at StackOverflow: https://stackoverflow.com/questions/36039840/elisp-bind-a-lambda-in-a-let-and-execute-it/36040068#36040068

To like or reply, open original post on Emacs.ch