Exemple #1
0
        public Value Get(Types.Symbol key)
        {
            Environment e = Find(key);

            if (e == null)
            {
                throw new RuntimeException(
                          "'" + key.GetName() + "' not found");
            }
            else
            {
                return(e._data[key.GetName()]);
            }
        }
Exemple #2
0
 public Environment Find(Types.Symbol key)
 {
     if (_data.ContainsKey(key.GetName()))
     {
         return(this);
     }
     else if (_outer != null)
     {
         return(_outer.Find(key));
     }
     else
     {
         return(null);
     }
 }
Exemple #3
0
 public Environment Set(Types.Symbol key, Value value)
 {
     _data[key.GetName()] = value;
     return(this);
 }