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