(current-scope)Returns the current scope map, or an empty map if no scope is active.
The scope map contains var->value bindings set via scoping. This is
primarily for internal use; prefer ask for accessing individual values.
Returns the current scope map, or an empty map if no scope is active. The scope map contains var->value bindings set via `scoping`. This is primarily for internal use; prefer `ask` for accessing individual values.
(get-scoped-var v)Retrieve a scoped value, falling back to the var's root binding.
If the var is in the current scope, returns the scoped value. If not in scope, returns the var's current value. If the var is unbound and not in scope, throws IllegalStateException.
This is the runtime implementation for the ask macro.
Retrieve a scoped value, falling back to the var's root binding. If the var is in the current scope, returns the scoped value. If not in scope, returns the var's current value. If the var is unbound and not in scope, throws IllegalStateException. This is the runtime implementation for the `ask` macro.
(merge-scope bindings)Merge new bindings into the current scope.
Takes a flat vector of [var1 val1 var2 val2 ...] and returns a new scope map
with these bindings added to (or overriding) the current scope. Used internally
by scoping to build the new scope map.
Merge new bindings into the current scope. Takes a flat vector of `[var1 val1 var2 val2 ...]` and returns a new scope map with these bindings added to (or overriding) the current scope. Used internally by `scoping` to build the new scope map.
(resolve-bindings bindings)Resolve symbols to vars in a bindings vector at compile time.
Transforms [sym1 val1 sym2 val2 ...] into [#'sym1 val1 #'sym2 val2 ...].
Used by scoping to convert user-provided symbols to var references.
Resolve symbols to vars in a bindings vector at compile time. Transforms `[sym1 val1 sym2 val2 ...]` into `[#'sym1 val1 #'sym2 val2 ...]`. Used by `scoping` to convert user-provided symbols to var references.
The ScopedValue instance holding the current scope map.
Stores a map of var->value bindings established via scoping. ScopedValues
provide efficient, inheritable context for virtual threads without the overhead
of Clojure's thread-local binding mechanism.
The ScopedValue instance holding the current scope map. Stores a map of var->value bindings established via `scoping`. ScopedValues provide efficient, inheritable context for virtual threads without the overhead of Clojure's thread-local binding mechanism.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |