コード例 #1
0
 internal Object getDefaultParamValue(Parameter p)
 {
     if (p.initCode != null)
         return p.initCode.eval(argSpecs.env);
     else
         return Missing.Value; //hmmm... could return null
 }
コード例 #2
0
 internal Env(Parameter[] vars, Object[] vals, Env parent)
 {
     this.vars = vars; this.vals = vals; this.parent = parent;
 }
コード例 #3
0
 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);
 }