protected virtual object GetDefaultParamValue(Parameter p) { if (p.InitCode != null) return p.InitCode.Eval(InnerArgsSpecs.Environment); else return Missing.Value; //hmmm... could return null }
protected object FindKeyParamValue(Parameter p, Cons args) { for (; args != null; args = args.Rest) { Symbol first = args.First as Symbol; if (args.First == p.Key) { if (args.Rest != null) { Object ret = Cons.GetSecond(args); if (ret == Missing.Value) { ret = GetDefaultParamValue(p); } return ret; } else throw new LispException("Key args must be provided in pairs of [:key value]"); } } return GetDefaultParamValue(p); }