private static Item Deref(SymbolSpace space, SymbolItem symbol) { var reference = space.Lookup(symbol.Name); return(reference is EvaluateableItem ? (reference as EvaluateableItem).Quote() : reference); }
public Item Flatten(SymbolSpace space) { var current = space.Lookup(this.Name); while (current.ItemType == ItemType.Symbol) { var symbol = (SymbolItem)current; if (symbol.IsQuoted) { break; } current = symbol.Evaluate(space); } return(current); }