Set() public method

Sets a variable with given symbol to a given value
public Set ( LSharp.Symbol symbol, object value ) : object
symbol LSharp.Symbol
value object
return object
Exemplo n.º 1
0
        /// <summary>
        /// Sets a variable with given symbol to a given value
        /// </summary>
        public object Set(Symbol symbol, object value)
        {
            if ((hashtable.ContainsKey(symbol)) || (previousEnvironment == null))
            {
                return(this.AssignLocal(symbol, value));
            }


            return(previousEnvironment.Set(symbol, value));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Binds the given symbol to the given value in the given
 /// environment
 /// </summary>
 public static object VarSet(Symbol symbol, Object value, Environment environment)
 {
     environment.Set(symbol, value);
     return value;
 }