Here's a simple test:
(let ((func (lambda (i)
(when (> i 0)
(print i)
(funcall func (1- i))))))
(funcall func 3))
It says (void-variable func)
, but why? When (funcall func 3)
is called then func already has a value. Why doesn't the inside of the lambda see the dynamically bound variable?