clojure.lang.Keyword.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中clojure.lang.Keyword.<init>()方法的一些代码示例,展示了Keyword.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Keyword.<init>()方法的具体详情如下:
包路径:clojure.lang.Keyword
类名称:Keyword
方法名:<init>

Keyword.<init>介绍

暂无

代码示例

代码示例来源:origin: videlalvaro/clochure

public static Keyword intern(Symbol sym){
  if(sym.meta() != null)
    sym = (Symbol) sym.withMeta(null);
  Util.clearCache(rq, table);
  Keyword k = new Keyword(sym);
  Reference<Keyword> existingRef = table.putIfAbsent(sym, new WeakReference<Keyword>(k,rq));
  if(existingRef == null)
    return k;
  Keyword existingk = existingRef.get();
  if(existingk != null)
    return existingk;
  //entry died in the interim, do over
  table.remove(sym, existingRef);
  return intern(sym);
}

代码示例来源:origin: org.dunaj/clojure

public static Keyword intern(Symbol sym){
  Keyword k = null;
  Reference<Keyword> existingRef = table.get(sym);
  if(existingRef == null)
    {
    Util.clearCache(rq, table);
    if(sym.meta() != null)
      sym = (Symbol) sym.withMeta(null);
    k = new Keyword(sym);
    existingRef = table.putIfAbsent(sym, new WeakReference<Keyword>(k, rq));
    }
  if(existingRef == null)
    return k;
  Keyword existingk = existingRef.get();
  if(existingk != null)
    return existingk;
  //entry died in the interim, do over
  table.remove(sym, existingRef);
  return intern(sym);
}

相关文章