public static Symbol For(string value) { Symbol result; if (Symbol.table.TryGetValue(value, out result)) return result; result = new Symbol(value); Symbol.table.Add(value, result); return result; }
public SchemeObject GetValue(Symbol key) { for (SchemeEnvironment env = this; env != null; env = env.parent) { SchemeObject value; if (env.dictionary.TryGetValue(key, out value)) return value; } throw new InvalidSyntaxException(); }
public void SetValue(Symbol key, SchemeObject value, bool isDefinition) { SchemeEnvironment env = this; if (!isDefinition) { for (; env != null; env = env.parent) if (env.dictionary.ContainsKey(key)) break; if (env == null) throw new InvalidSyntaxException(); } env.dictionary[key] = value; }
public void Add(Symbol key, SchemeObject value) { this.dictionary[key] = value; }
internal AssignmentContinuation(Symbol destination, bool isDefinition, SchemeEnvironment environment) : base(environment, ContinuationKind.Assignment) { this.Destination = destination; this.IsDefinition = isDefinition; }