Description
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.
Throws an 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.