public override object Eval(Env env) { // Debug.WriteLine("Eval->Assign: " + id); object valEval = val.Eval(env); // DebugInfo.EvalExpression(this); return env.Bind(id, valEval); }
public override object Eval(Env env) { // Debug.WriteLine("Eval->Assign: " + id); object valEval = val.Eval(env); // DebugInfo.EvalExpression(this); return(env.Bind(id, valEval)); }
// this and above should be merged somehow (may be obvious actually) /* public override object Bind(Symbol[] inSyms, Object[] inVals) * { * for (int pos=0; pos < inSyms.Length; pos++) * { * Symbol currSym = (Symbol) inSyms[pos]; * * if (!currSym.ToString().Equals(".")) * this.bindings[currSym] = inVals[pos]; * else * { * // multiple values passed in (R5RS 4.1.4) * currSym = (Symbol) inSyms[pos+1]; * this.bindings[currSym] = Pair.FromArrayAt(inVals,pos); * break; * } * } * return null; * } */ override public object Bind(Symbol id, Object val) { if (this.bindings.ContainsKey(id) || env == The_Empty_Env) { bindings[id] = val; return(id); } else { return(env.Bind(id, val)); } }