//This actually declares a new binding public void Set(string key, IValue value) { if (BoundVariables.TryGetValue(key, out Binding val)) { val.Value = value; } else { BoundVariables[key] = new Binding(value); } }
private Binding GetBinding(string key) { BoundVariables.TryGetValue(key, out Binding val); return(val ?? Parent?.GetBinding(key) ?? null); }
public void Remove(string key) { BoundVariables.Remove(key); }
public IValue Get(string key) { BoundVariables.TryGetValue(key, out Binding val); return(val?.Value ?? Parent?.Get(key) ?? Value.Nil); }