The problem arises when you reuse your own macro in some other context, and your smart variables with names are efficiently redundant then, since they are all in the same namespace.
I can come up with an example when a closure is used that accesses the variable in the application (let) , but is passed to a macro that also uses a closure (let) that defines a "safe" variable with a name conflict. This is a contrived example, sorry, I canโt think about the real world right now.
(defmacro my/a (x) (let ((my/safe-name x)) `(progn ,(my/b (lambda () my/safe-name)) ,my/safe-name))) (defmacro my/b (f) `(let ((my/safe-name 4)) (when (evenp (funcall ,f)) (print "F is even!")))) (my/a 3) ; will print "F is even", but it shouldn't
d11wtq
source share