「clojure1.4.0/src/jvm/clojure/lang/Namespace.java/intern()」の編集履歴(バックアップ)一覧はこちら
追加された行は緑色になります。
削除された行は赤色になります。
[一つ上:&link_parent()] [&link_edit()]
#highlight(linenumber,java) {{
public Var intern(Symbol sym){
if(sym.ns != null)
{
throw new IllegalArgumentException("Can't intern namespace-qualified symbol");
}
IPersistentMap map = getMappings();
Object o;
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;
}
}}