public Object get(Object target){ if(target instanceof IKeywordLookup || target instanceof ILookup) return this; return RT.get(target,k); }
public Object get(Object target){ if(target instanceof IKeywordLookup || target instanceof ILookup) return this; return RT.get(target,k); }
public Object invoke(Object obj, Object notFound) { return RT.get(obj, this, notFound); }
public Object invoke(Object obj) { return RT.get(obj, this); }
public Object invoke(Object obj) { return RT.get(obj, this); }
public Object invoke(Object obj, Object notFound) { return RT.get(obj, this, notFound); }
public boolean canEmitIntrinsicPredicate(){ return method != null && RT.get(Intrinsics.preds, method.toString()) != null; }
/** * Indexer implements IFn for attr access * * @param obj - must be IPersistentMap * @return the value at the key or nil if not found * @ */ final public Object invoke(Object obj) { if(obj instanceof ILookup) return ((ILookup)obj).valAt(this); return RT.get(obj, this); }
final public Object invoke(Object obj, Object notFound) { if(obj instanceof ILookup) return ((ILookup)obj).valAt(this,notFound); return RT.get(obj, this, notFound); }
final public Object invoke(Object obj, Object notFound) { if(obj instanceof ILookup) return ((ILookup)obj).valAt(this,notFound); return RT.get(obj, this, notFound); }
static public Object getCompilerOption(Keyword k){ return RT.get(COMPILER_OPTIONS.deref(),k); }
private Object readTagged(PushbackReader reader, Symbol tag, IPersistentMap opts){ Object o = read(reader, true, null, true, opts); ILookup readers = (ILookup)RT.get(opts, READERS); IFn dataReader = (IFn)RT.get(readers, tag); if(dataReader == null) dataReader = (IFn)RT.get(RT.DEFAULT_DATA_READERS.deref(),tag); if(dataReader == null){ IFn defaultReader = (IFn)RT.get(opts, DEFAULT); if(defaultReader != null) return defaultReader.invoke(tag, o); else throw new RuntimeException("No reader function for tag " + tag.toString()); } else return dataReader.invoke(o); }
private static Symbol tagOf(Object o){ Object tag = RT.get(RT.meta(o), RT.TAG_KEY); if(tag instanceof Symbol) return (Symbol) tag; else if(tag instanceof String) return Symbol.intern(null, (String) tag); return null; }
static boolean hasTag(Object o, Object tag){ return Util.equals(tag, RT.get(RT.meta(o), TAG_KEY)); }
public static boolean isQualifiedSpecials(){ Namespace n = currentNS(); IPersistentMap mm = n.meta(); return RT.booleanCast(RT.get(mm,qualifiedSpecialsKey)); }
static LocalBinding referenceLocal(Symbol sym) { if(!LOCAL_ENV.isBound()) return null; LocalBinding b = (LocalBinding) RT.get(LOCAL_ENV.deref(), sym); if(b != null) { ObjMethod method = (ObjMethod) METHOD.deref(); closeOver(b, method); } return b; }
static void closeOver(LocalBinding b, ObjMethod method){ if(b != null && method != null) { if(RT.get(method.locals, b) == null) { method.objx.closes = (IPersistentMap) RT.assoc(method.objx.closes, b, b); closeOver(b, method.parent); } else if(IN_CATCH_FINALLY.deref() != null) { method.localsUsedInCatchFinally = (PersistentHashSet) method.localsUsedInCatchFinally.cons(b.idx); } } }
private static void registerVar(Var var) { if(!VARS.isBound()) return; IPersistentMap varsMap = (IPersistentMap) VARS.deref(); Object id = RT.get(varsMap, var); if(id == null) { VARS.set(RT.assoc(varsMap, var, registerConstant(var))); } // if(varsMap != null && RT.get(varsMap, var) == null) // VARS.set(RT.assoc(varsMap, var, var)); }
boolean isVolatile(LocalBinding lb){ return RT.booleanCast(RT.contains(fields, lb.sym)) && RT.booleanCast(RT.get(lb.sym.meta(), Keyword.intern("volatile-mutable"))); }
boolean isMutable(LocalBinding lb){ return isVolatile(lb) || RT.booleanCast(RT.contains(fields, lb.sym)) && RT.booleanCast(RT.get(lb.sym.meta(), Keyword.intern("unsynchronized-mutable"))); }