I want to rebind a special variable inside of a loop. Now, normally, this is accomplished using a let
.
(let ((*read-eval* nil))
(do-something-here))
But since the loop
macro has these nice with
clauses, I thought I might be able to do so in there. The expression (macroexpand '(loop with *read-eval* = nil))
ends up expanding the binding to a let
, so it will definitely work on my implementation specifically. But I can't find anything in the standard indicating that this is standardized behavior. So, I suppose, my question is this:
(loop with *read-eval* = nil
for i from 1 to 10
do (something-involving-the-read-function))
Are conforming implementations required to modify the existing *read-eval*
variable, or is there a risk that they might create a new lexical variable of the same name?