aboutsummaryrefslogtreecommitdiff
path: root/src/boot/ast.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-05-18 04:01:53 +0000
committerdos-reis <gdr@axiomatics.org>2011-05-18 04:01:53 +0000
commitfd748db1e503f9d27de5b91ba607c550ccd16991 (patch)
treeca96cf4ede461bf9cf04502c2aa6b062d52fd9c4 /src/boot/ast.boot
parent24d0e78582cacadeb56a0e0efdd41ce5ff3a9354 (diff)
downloadopen-axiom-fd748db1e503f9d27de5b91ba607c550ccd16991.tar.gz
more Boot cleanup
Diffstat (limited to 'src/boot/ast.boot')
-rw-r--r--src/boot/ast.boot28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/boot/ast.boot b/src/boot/ast.boot
index 61fc648a..75e582e6 100644
--- a/src/boot/ast.boot
+++ b/src/boot/ast.boot
@@ -125,6 +125,16 @@ bfGenSymbol()==
$GenVarCounter := $GenVarCounter+1
makeSymbol strconc('"bfVar#",toString $GenVarCounter)
+bfLetVar: () -> %Symbol
+bfLetVar() ==
+ $letGenVarCounter := $letGenVarCounter + 1
+ makeSymbol strconc('"LETTMP#",toString $letGenVarCounter)
+
+bfIsVar: () -> %Symbol
+bfIsVar() ==
+ $isGenVarCounter := $isGenVarCounter + 1
+ makeSymbol strconc('"ISTMP#",toString $isGenVarCounter)
+
bfColon: %Thing -> %Form
bfColon x==
["COLON",x]
@@ -545,8 +555,7 @@ bfLET1(lhs,rhs) ==
l2 is ["PROGN",:.] => bfMKPROGN [l1,:rest l2]
if symbol? first l2 then l2 := [l2,:nil]
bfMKPROGN [l1,:l2,name]
- g := makeSymbol strconc('"LETTMP#",toString $letGenVarCounter)
- $letGenVarCounter := $letGenVarCounter + 1
+ g := bfLetVar()
rhs1 := ['L%T,g,rhs]
let1 := bfLET1(lhs,g)
let1 is ["PROGN",:.] => bfMKPROGN [rhs1,:rest let1]
@@ -582,8 +591,7 @@ bfLET2(lhs,rhs) ==
lhs is ['append,var1,var2] =>
patrev := bfISReverse(var2,var1)
rev := ['reverse,rhs]
- g := makeSymbol strconc('"LETTMP#", toString $letGenVarCounter)
- $letGenVarCounter := $letGenVarCounter + 1
+ g := bfLetVar()
l2 := bfLET2(patrev,g)
if cons? l2 and atom first l2 then
l2 := [l2,:nil]
@@ -607,7 +615,7 @@ bfLET2(lhs,rhs) ==
bfLET(lhs,rhs) ==
- $letGenVarCounter : local := 1
+ $letGenVarCounter : local := 0
bfLET1(lhs,rhs)
addCARorCDR(acc,expr) ==
@@ -639,8 +647,8 @@ bfISApplication(op,left,right)==
[op ,left,right]
bfIS(left,right)==
- $isGenVarCounter: local :=1
- $inDefIS:local :=true
+ $isGenVarCounter: local := 0
+ $inDefIS: local :=true
bfIS1(left,right)
bfISReverse(x,a) ==
@@ -666,8 +674,7 @@ bfIS1(lhs,rhs) ==
bfAND [bfIS1(lhs,d),bfMKPROGN [l,'T]]
rhs is ["EQUAL",a] => bfQ(lhs,a)
cons? lhs =>
- g := makeSymbol strconc('"ISTMP#",toString $isGenVarCounter)
- $isGenVarCounter := $isGenVarCounter + 1
+ g := bfIsVar()
bfMKPROGN [['L%T,g,lhs],bfIS1(g,rhs)]
rhs is ['CONS,a,b] =>
a is "DOT" =>
@@ -683,8 +690,7 @@ bfIS1(lhs,rhs) ==
bfAND [['CONSP,lhs],a1,b1]
rhs is ['append,a,b] =>
patrev := bfISReverse(b,a)
- g := makeSymbol strconc('"ISTMP#",toString $isGenVarCounter)
- $isGenVarCounter := $isGenVarCounter + 1
+ g := bfIsVar()
rev := bfAND [['CONSP,lhs],['PROGN,['L%T,g,['reverse,lhs]],'T]]
l2 := bfIS1(g,patrev)
if cons? l2 and atom first l2 then l2 := [l2,:nil]