aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-07-26 21:31:57 +0000
committerdos-reis <gdr@axiomatics.org>2010-07-26 21:31:57 +0000
commit6177d66b74f48a5cd63b62acad815299fcaaa884 (patch)
treeffb26912b3e2cae0a1c8680e5d8fef9d46ad4097
parentd05164b7bc0d0998e9e220497386ff7d7cc9a445 (diff)
downloadopen-axiom-6177d66b74f48a5cd63b62acad815299fcaaa884.tar.gz
* interp/g-opt.boot (optCond): Work harder at denesting nested
if-expressions.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/interp/g-opt.boot11
2 files changed, 10 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index cd08dcdf..92ebd761 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2010-07-26 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-opt.boot (optCond): Work harder at denesting nested
+ if-expressions.
+
+2010-07-26 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/g-opt.boot ($VMsideEffectFreeOperators): Include new
opcodes %icst0, %icst1, %when, and %ccst.
* interp/g-util.boot: Expand %ccst.
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index c7121f01..2a1065b8 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -301,23 +301,22 @@ optMkRecord ["mkRecord",:u] ==
["VECTOR",:u]
optCond (x is ['COND,:l]) ==
- if l is [a,[aa,b]] and aa = '%true and b is ["COND",:c] then
+ if l is [a,[aa,b]] and aa = '%true and b is ['COND,:c] then
x.rest.rest := c
if l is [[p1,:c1],[p2,:c2],:.] then
if (p1 is ['%not,=p2]) or (p2 is ['%not,=p1]) then
l:=[[p1,:c1],['%true,:c2]]
x.rest := l
c1 is ['NIL] and p2 = '%true and first c2 = '%true =>
- p1 is ['%not,p1']=> return p1'
- return ['%not,p1]
+ return optNot ['%not,p1]
l is [[p1,:c1],[p2,:c2],[p3,:c3]] and p3 = '%true =>
EqualBarGensym(c1,c3) =>
- ["COND",[['%or,p1,['%not,p2]],:c1],['%true,:c2]]
- EqualBarGensym(c1,c2) => ["COND",[['%or,p1,p2],:c1],['%true,:c3]]
+ optCond ['COND,[['%or,p1,['%not,p2]],:c1],['%true,:c2]]
+ EqualBarGensym(c1,c2) => optCond ['COND,[['%or,p1,p2],:c1],['%true,:c3]]
x
for y in tails l repeat
while y is [[a1,c1],[a2,c2],:y'] and EqualBarGensym(c1,c2) repeat
- a:=['%or,a1,a2]
+ a := ['%or,a1,a2]
first(y).first := a
y.rest := y'
x