public dynamic eval(Dictionary <string, Expr> env) { // look up in environment? // if not in environment throw exception if (env.ContainsKey(name)) { return(env[name]); } else if (BuiltIn.Lookup(name)) { return(new PrimFuncExpr(name).eval(env)); } else { throw new EvaluatorException(String.Format("{0}: undefined", name)); } }
public dynamic apply(List <Expr> parameters) { return(BuiltIn.Call(fun, parameters, env)); }