Note On Lexical Variable Access - SBCL 1.0.31 User Manual
Description: SBCL 1.0.31 User Manual

Previous: Variable Value Availability, Up: Variable Access

#### 5.4.2 Note On Lexical Variable Access

When the debugger command loop establishes variable bindings for available variables, these variable bindings have lexical scope and dynamic extent.1 You can close over them, but such closures can't be used as upward funargs.

You can also set local variables using `setq`, but if the variable was closed over in the original source and never set, then setting the variable in the debugger may not change the value in all the functions the variable is defined in. Another risk of setting variables is that you may assign a value of a type that the compiler proved the variable could never take on. This may result in bad things happening.

#### Footnotes

[1] The variable bindings are actually created using the Lisp `symbol-macrolet` special form.