I want to do something like that in Common Lisp:
(defparameter *fun*
(lambda () x))
(let ((x 0))
(funcall *fun*)) ;should return 0
I want to access a local binding in a function, that is not defined, when I define the function.
If I use x as parameter, it would work, but I can't change the value of the variable:
(defparameter *fun*
(lambda (x) (setf x (+ x 1))))
(let ((x 0))
(funcall *fun* x)) ;should return 1, would return 0
How can I do what I want?