Skip to main content

load_ns

Function load_ns 

Source
pub fn load_ns(
    globals: Arc<GlobalEnv>,
    spec: &RequireSpec,
    current_ns: &str,
) -> Result<(), EvalError>
Expand description

Find, load, and wire up the source file for spec.ns.

  • Idempotent: if already loaded, skips file evaluation but still applies alias/refer in the current namespace.
  • Same-thread cycle detection: returns an error if the current thread is already loading spec.ns (true circular require).
  • Cross-thread coordination: if a different thread is loading spec.ns, waits for it to finish (via GlobalEnv::loading_done) instead of reporting a spurious “circular require” error.