private ExpressionStackEntry Eval(ISeq <Statement> statements, ExpressionStackEntry entry) { if (statements == null) { throw new ArgumentNullException("statements"); } // Eval the expression and save it in a temporary. If result is a structure, make the implied // value semantics explicit by cloning the value. var id = gensym(); var cell = new VariableCell(id); compEnv.AddVariable(id, ArgLocal.Local, false, true, compEnv.SubstituteType(entry.Expression.Type(compEnv))); statements.Add(new ExpressionStatement(cell.Write(entry.Expression.CloneIfStruct(compEnv)))); // We never re-write to temporaries, so this stack entry now has no effects, not even a 'read' effect. // Also, the result's Expression.IsValue will be true. return(new ExpressionStackEntry(cell.Read(), bottom)); }
public void Push(ExpressionStackEntry entry) { stack.Add(entry); }