public Var intern(Symbol sym){
if(sym.ns != null)
{
}
IPersistentMap map = getMappings();
Var v = null;
while((o = map.valAt(sym)) == null)
{
if(v == null)
v = new Var(this, sym);
IPersistentMap newMap = map.assoc(sym, v);
mappings.compareAndSet(map, newMap);
map = getMappings();
}
if(o instanceof Var && ((Var) o).ns == this)
return (Var) o;
if(v == null)
v = new Var(this, sym);
warnOrFailOnReplace(sym, o, v);
while(!mappings.compareAndSet(map, map.assoc(sym, v)))
map = getMappings();
return v;
}
最終更新:2012年07月07日 14:55