public dynamic this [Symbol sym] { get { return(Resolve(sym, this)); } set { var val = value; if (val is string) { val = new KumaString(val); } if (KumaNumber.IsConvertable(val)) { val = new KumaNumber(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 KumaString(val); } if (KumaNumber.IsConvertable(val)) { val = new KumaNumber(val); } Variables[name] = val; } }