protected Object computeAssign(Environment env, Object rvalue) { ASTree l = left(); if (l instanceof Name) { env.put(((Name) l).name(), rvalue); return rvalue; } else throw new StoneException("bad assignment", this); }
public Object eval(Environment env) { Object value = env.get(name()); if (value == null) throw new StoneException("undefined name: " + name(), this); else return value; }