Skip to main content

Module versioned

Module versioned 

Source
Expand description

Shared versioned-symbol/namespace resolution service.

This is the single implementation used by every execution tier — the tree-walking interpreter, the IR interpreter, JIT-compiled code (via the rt_load_global* runtime bridges), and AOT binaries.

§Model

Resolving ns/name@commit means: ensure the versioned namespace "ns@commit" is loaded (lazily, from an embedded builtin source or from git history), then perform a plain lookup_in_ns("ns@commit", name). Versioned namespaces are immutable once loaded, so a resolved value never changes for the lifetime of the process.

§Native (Rust-backed) functions

Native functions registered via cljrs-interop::Registry have no Clojure source to fetch, and the binary is a single unit at runtime — we can’t “go back in time” to a previous compiled implementation. The current contract is: versioned lookups of a native symbol resolve to the HEAD (current) implementation regardless of the requested commit (see native_head_fallback).

Functions§

base_ns_name
Strip a trailing @<commit> suffix from a namespace name, returning the base namespace. "my.lib@abc1234""my.lib"; names without a valid commit-hash suffix are returned unchanged.
ensure_versioned_ns_loaded
Ensure the versioned namespace "<base_ns>@<commit>" is loaded, returning its name.
pin_if_available
Pin base_ns@commit if any source for it is locatable, returning whether it was loaded.
resolve_versioned_value
Resolve the value of name pinned at commit.