internal Object getDefaultParamValue(Parameter p) { if (p.initCode != null) return p.initCode.eval(argSpecs.env); else return Missing.Value; //hmmm... could return null }
internal Env(Parameter[] vars, Object[] vals, Env parent) { this.vars = vars; this.vals = vals; this.parent = parent; }
internal Object findKeyParamValue(Parameter p, Cons args) { for (; args != null; args = args.rest) { if (args.first == p.key) { if (args.rest != null) { Object ret = Cons.Second(args); if (ret == Missing.Value) { ret = getDefaultParamValue(p); } return ret; } else throw new Exception("Key args must be provided in pairs of [:key value]"); } } return getDefaultParamValue(p); }