- lexical scope (static scope): dependent only on the program text.
- dynamic scope: dependent on the runtime call stack.
(def x 1)default Var isstatic, usingletfor local Var,with-redefsto change the root binding var within its scope (visible in all threads).(def ^:dynamic x 1)dynamic Var, usingbindingto change value (thread-local, cannot be seen by any other thread).
In example bellow:
bindingonly changes the value of*dynamic-var*within the scope of the binding expression