diff options
author | Rich Hickey <richhickey@gmail.com> | 2008-09-16 11:39:38 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2008-09-16 11:39:38 +0000 |
commit | edf6f303654ae113d733ee7347200143c7fdd2de (patch) | |
tree | ef3987db2f3d641d8c45dff0809ff55a90604b3f /src | |
parent | 9016a7ed9e5e728dff5e7c855b1baabccaf272d2 (diff) |
fixed resolveIns to resolve alias
Diffstat (limited to 'src')
-rw-r--r-- | src/jvm/clojure/lang/Compiler.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/jvm/clojure/lang/Compiler.java b/src/jvm/clojure/lang/Compiler.java index e087d088..670db04a 100644 --- a/src/jvm/clojure/lang/Compiler.java +++ b/src/jvm/clojure/lang/Compiler.java @@ -3973,10 +3973,14 @@ static Object resolve(Symbol sym) throws Exception{ } static private Namespace namespaceFor(Symbol sym){ + return namespaceFor(currentNS(),sym); +} + +static private Namespace namespaceFor(Namespace inns,Symbol sym){ //note, presumes non-nil sym.ns // first check against currentNS' aliases... Symbol nsSym = Symbol.create(sym.ns); - Namespace ns = currentNS().lookupAlias(nsSym); + Namespace ns = inns.lookupAlias(nsSym); if(ns == null) { // ...otherwise check the Namespaces map. @@ -3989,7 +3993,7 @@ static public Object resolveIn(Namespace n, Symbol sym) throws Exception{ //note - ns-qualified vars must already exist if(sym.ns != null) { - Namespace ns = namespaceFor(sym); + Namespace ns = namespaceFor(n,sym); if(ns == null) throw new Exception("No such namespace: " + sym.ns); @@ -4022,7 +4026,7 @@ static public Object maybeResolveIn(Namespace n, Symbol sym) throws Exception{ //note - ns-qualified vars must already exist if(sym.ns != null) { - Namespace ns = namespaceFor(sym); + Namespace ns = namespaceFor(n, sym); if(ns == null) return null; Var v = ns.findInternedVar(Symbol.create(sym.name)); |