Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkg/rt/lang.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,16 @@ func LookupOrRegisterNS(name string) *vm.Namespace {
}

func LookupOrRegisterNSNoLoad(name string) *vm.Namespace {
// Resolve the alias BEFORE touching the registry, as the loading callers do.
// Without this, LookupOrRegisterNSNoLoad("clojure.core") registers a DISTINCT
// "clojure.core" namespace instead of returning the canonical "core" — so the
// generated primitive registrar (RegisterGeneratedPrimitives, which calls this
// with "clojure.core"/"clojure.string"/…) Defs into the wrong namespace,
// invisible to core.lg's own bootstrap compile. Hand-registered primitives
// hid this by also Def'ing into the canonical ns via installLangNS; a primitive
// hoisted to //lg:native has ONLY the generated registration, so it must land
// in the canonical namespace to resolve.
name = resolveNSAlias(name)
nsMu.RLock()
e := nsRegistry[name]
nsMu.RUnlock()
Expand Down
Loading