Пример #1
0
 //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);
     }
 }
Пример #2
0
 private Binding GetBinding(string key)
 {
     BoundVariables.TryGetValue(key, out Binding val);
     return(val ?? Parent?.GetBinding(key) ?? null);
 }
Пример #3
0
 public void Remove(string key)
 {
     BoundVariables.Remove(key);
 }
Пример #4
0
 public IValue Get(string key)
 {
     BoundVariables.TryGetValue(key, out Binding val);
     return(val?.Value ?? Parent?.Get(key) ?? Value.Nil);
 }