Наследование: IExpression
Пример #1
0
        public Value Create(string name, Value value)
        {
            if (Variables.ContainsKey(name))
                Variables[name] = value;
            else
                Variables.Add(name, value);

            return value;
        }
Пример #2
0
        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);
        }