Esempio n. 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);
		}
Esempio n. 2
0
	internal Env(Parameter[] vars, Object[] vals, Env parent)
		{
		this.vars = vars; this.vals = vals; this.parent = parent;
		}
Esempio n. 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
		}
Esempio n. 4
0
	internal Env(Parameter[] vars, Object[] vals, Env parent, Interpreter interp)
		{
		this.vars = vars; this.vals = vals; this.parent = parent;
	    this.interp = interp;
		}