public dynamic this[Symbol sym] { get { return(Resolve(sym, this)); } set { var val = value; if (val is string) { val = new NovaString(val); } if (NovaNumber.IsConvertable(val)) { val = new NovaNumber(val); } SymVars[sym] = val; } }
public dynamic this[string name] { get { return(Resolve(name)); } set { if (CheckConstant(name)) { throw new ConstantException( string.Format("{0} is already defined as a constant in this scope or a parent scope.", name)); } var val = value; if (val is string) { val = new NovaString(val); } if (NovaNumber.IsConvertable(val)) { val = new NovaNumber(val); } Variables[name] = val; } }