Suppose you save the following code to some file test.el and then do load-file test.el
;;; -*- lexical-binding: t -*-
(let ((closure-vbl 0))
(defun tst ()
(eval 'closure-vbl)))
(tst)
You get the error tst: Symbol's value as variable is void: closure-vbl
. (Replacing (eval 'closure-vbl)
with (symbol-function 'closure-vbl)
gives the same error.)
Why is this? I don't understand what is wrong with the above code? Am I miunderstanding some property of emacs closures? Or are they simply not developed enough to deal with non-trivial situations.