public Object get(int index){ return RT.nth(this, index); }
public Object get(int index){ return RT.nth(this, index); }
public Object get(int index){ return RT.nth(this, index); }
public Object get(int index){ return RT.nth(this, index); }
public Object get(int index){ return RT.nth(this, index); }
public Object get(int index){ return RT.nth(this, index); }
static Object getFromOrig(Object coll, Object key, Object notFound){ if(coll == null) return notFound; else if(coll instanceof Map) { Map m = (Map) coll; if(m.containsKey(key)) return m.get(key); return notFound; } else if(coll instanceof IPersistentSet) { IPersistentSet set = (IPersistentSet) coll; if(set.contains(key)) return set.get(key); return notFound; } else if(key instanceof Number && (coll instanceof String || coll.getClass().isArray())) { int n = ((Number) key).intValue(); return n >= 0 && n < count(coll) ? nth(coll, n) : notFound; } return notFound; }
static Object getFrom(Object coll, Object key){ if(coll == null) return null; else if(coll instanceof Map) { Map m = (Map) coll; return m.get(key); } else if(coll instanceof IPersistentSet) { IPersistentSet set = (IPersistentSet) coll; return set.get(key); } else if(key instanceof Number && (coll instanceof String || coll.getClass().isArray())) { int n = ((Number) key).intValue(); if(n >= 0 && n < count(coll)) return nth(coll, n); return null; } else if(Protocol.satisfiesILookup(coll)) return Protocol.bridgeILookupGet(coll, key, null); return null; }
static Object getFrom(Object coll, Object key, Object notFound){ if(coll == null) return notFound; else if(coll instanceof Map) { Map m = (Map) coll; if(m.containsKey(key)) return m.get(key); return notFound; } else if(coll instanceof IPersistentSet) { IPersistentSet set = (IPersistentSet) coll; if(set.contains(key)) return set.get(key); return notFound; } else if(key instanceof Number && (coll instanceof String || coll.getClass().isArray())) { int n = ((Number) key).intValue(); return n >= 0 && n < count(coll) ? nth(coll, n) : notFound; } else if(Protocol.satisfiesILookup(coll)) return Protocol.bridgeILookupGet(coll, key, notFound); return notFound; }
private static final class DefaultComparator implements Comparator, Serializable { public int compare(Object o1, Object o2){ return Util.compare(o1, o2); } private Object readResolve() throws ObjectStreamException { // ensures that we aren't hanging onto a new default comparator for every // sorted set, etc., we deserialize return DEFAULT_COMPARATOR; } }
int high = ((Number)RT.nth(keys, RT.count(keys)-1)).intValue();
Expression e = analyse(env, RT.nth(form, 2)); Expression body = analyse(env,RT.nth(form, 2)); return Loop.create(syms, initials, body); values[i]=analyse(env,RT.nth(form,(i+1))); Expression value=analyse(env,RT.nth(form,1)); return Return.create(value); switch (n) { case 4: return If.create(analyse(env,RT.nth(form, 1)), analyse(env,RT.nth(form, 2)), analyse(env,RT.nth(form, 3))); case 3: return If.create(analyse(env,RT.nth(form, 1)), analyse(env,RT.nth(form, 2)),Constant.NULL); default: throw new KissException("Wrong number of forms in if expression: "+n); switch (n) { case 3: return InstanceOf.create(analyseType(RT.nth(form, 1)), analyse(env,RT.nth(form, 2))); default: throw new KissException("Wrong number of forms in instance? expression: "+n); Symbol sym=(Symbol)RT.nth(form,1); return Def.create(sym,analyse(env,RT.nth(form, 2))); Expression[] exps=new Expression[n-1]; for (int i=1; i<n; i++) {