|
|
|
|
|
by dan-robertson
2868 days ago
|
|
You can’t know whether you are shadowing an outer variable. With dynamic scope: (defun get-x () x)
(defun foo (let ((x 7)) (get-x)))
(foo) ;; => 7 (not shadowing x)
(let ((x 4)) (foo)) ;; => 7 (is shadowing x)
(setq old-get-x #'get-x)
(defun get-x () (let ((x 10)) (funcall old-get-x)))
(foo) ;; => 10
|
|