From 599bdffb5ac4ddcb7605eb4937d74608d4607890 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 4 Jun 2017 10:21:51 +1000 Subject: [PATCH] Add comment to consider side effects. --- cmd/puffs-gen-c/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/puffs-gen-c/main.go b/cmd/puffs-gen-c/main.go index b8e07e3c..b4c23cc9 100644 --- a/cmd/puffs-gen-c/main.go +++ b/cmd/puffs-gen-c/main.go @@ -723,6 +723,9 @@ func (g *gen) writeExpr(n *a.Expr, rp replacementPolicy, depth uint32) error { } // TODO: check that this works with nested call-suspendibles: // "foo?().bar().qux?()(p?(), q?())". + // + // Also be aware of evaluation order in the presence of side effects: + // in "foo(a?(), b!(), c?())", b should be called between a and c. g.printf("%s%d", tPrefix, g.perFunc.tempR) g.perFunc.tempR++ return nil