From e37be16362b844403c5d4c47fa91fd2540389041 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 8 Dec 2011 00:46:22 +0000 Subject: * interp/g-opt.boot: %writeString, %writeNewline and %writeLine are side-effect full. (removeSeq!): Tidy. Skip side-effectfree statements. --- src/interp/g-opt.boot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/interp') diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index 05708d68..1813d18e 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -228,11 +228,12 @@ removeSeq! x == walkWith!(x,function f) where x := first xs x is "/throwAway" => g rest xs -- skip garbages x is ['%seq,:.] => -- splice sub-sequences - ys := g x.args => - lastNode(ys).rest := g rest xs - ys + ys := x.args => + lastNode(ys).rest := rest xs + g ys g rest xs -- skip empty statements rest xs = nil => xs + sideEffectFree? x => g rest xs -- skip effect-less statements. xs.rest := g rest xs xs @@ -564,7 +565,6 @@ $VMsideEffectFreeOperators == %bitvecnot %bitvecand %bitvecnand %bivecor %bitvecnor %bitvecxor %bitveccopy %bitvecconc %bitveclength %bitvecref %bitveceq %bitveclt %before? %equal %sptreq %ident? %property %tref - %writeString %writeNewline %writeLine %void %retract %pullback %lambda %closure) ++ List of simple VM operators -- cgit v1.2.3