public Value Create(string name, Value value) { if (Variables.ContainsKey(name)) Variables[name] = value; else Variables.Add(name, value); return value; }
public Value Find(string name, Value newval = null) { if (Variables.ContainsKey(name)) { if (newval != null) Variables[name] = newval; return Variables[name]; } else if (Parent == null) throw new KeyNotFoundException("Unknown variable: " + name); else return Parent.Find(name, newval); }