with-shadowed-bindings establishes a new lexical context within which specified bindings are explicitly shadowed, making it clear that they are not referenced within, thereby reducing cognitive load.
bindings &body forms => results
Arguments and Values
- bindings -- A list.
- forms -- An implicit progn.
- results -- The values of the forms.
Establishes a new lexical context within which the named bindings cannot be directly accessed, executes forms as an implicit progn within that context and returns the results.
Each binding names a binding to shadow, of either of the following types:
- A symbol names a variable or symbol-macro to shadow.
- A list of 2 elements with
function as the first element and a function name as second element names a function or macro to shadow.
with-shadowed-bindings:invalid-access error if an attempt is made to access any of the shadowed bindings within forms.
Currently, no attempt is made to detect if the named bindings to shadow are actually accessible in a parent environment.
Currently, there is no way to define new kinds of bindings that one could shadow.
For now, see the unit tests for examples.
Generic Function with-shadowed-bindings:kind
condition => kind
Generic Function with-shadowed-bindings:name
condition => name
Returns the appropriate slot value from a
name is usually a symbol. In the case of a setf function, it would be