Skip to content

Commit

Permalink
renamed table() to getns()
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Jan 22, 2008
1 parent 345aff1 commit dca114e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions clojure.iml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4" relativePaths="true" type="JAVA_MODULE">
<module relativePaths="true" type="JAVA_MODULE" version="4">
<component name="BuildJarSettings">
<containerInfo>
<containerElement type="module" name="clojure">
Expand All @@ -11,7 +11,6 @@
<setting name="buildJar" value="true" />
<setting name="mainClass" value="clojure.lang.Compiler" />
</component>
<component name="ModuleRootManager" />
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/classes" />
<exclude-output />
Expand Down
10 changes: 5 additions & 5 deletions src/jvm/clojure/lang/Var.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static Var intern(Symbol sym, Object root){
}

public static Var intern(Symbol sym, Object root, boolean replaceRoot){
ConcurrentHashMap<Symbol, Var> table = table(sym);
ConcurrentHashMap<Symbol, Var> table = getns(sym);
Var dvout = table.get(sym);
boolean present = dvout != null;

Expand All @@ -83,7 +83,7 @@ public String toString(){
}

public static Var intern(Symbol sym){
ConcurrentHashMap<Symbol, Var> table = table(sym);
ConcurrentHashMap<Symbol, Var> table = getns(sym);
Var dvout = table.get(sym);
if(dvout != null)
return dvout;
Expand All @@ -95,14 +95,14 @@ public static Var intern(Symbol sym){
}

public static void unintern(Symbol sym){
table(sym).remove(sym);
getns(sym).remove(sym);
}

public static Var find(Symbol sym){
return table(sym).get(sym);
return getns(sym).get(sym);
}

static ConcurrentHashMap<Symbol, Var> table(Symbol sym){
static ConcurrentHashMap<Symbol, Var> getns(Symbol sym){
String name = sym.ns;
if(name == null)
throw new IllegalArgumentException("Var names must have namespace");
Expand Down

0 comments on commit dca114e

Please sign in to comment.