aboutsummaryrefslogtreecommitdiff
path: root/src/interp/i-util.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-01-03 01:35:30 +0000
committerdos-reis <gdr@axiomatics.org>2009-01-03 01:35:30 +0000
commit844be40b5b876fffd816f285f87711cca6ef3121 (patch)
tree311bee29b8d4edbdd5006ebabf712f9f3bb97c73 /src/interp/i-util.boot
parentc13363c1cf68242db7fac7970baa80fcd8911972 (diff)
downloadopen-axiom-844be40b5b876fffd816f285f87711cca6ef3121.tar.gz
* interp/buildom.boot (UnionEqual): Don't call orderUnionEntries.
(coerceUn2E): Likewise. (mkUnionFunList): Likewise. * interp/i-coerce.boot (coerceUnion2Branch): Likewise. (coerceBranch2Union): Likewise. ($newCompilerUnionFlag): Remove. (orderUnionEntries): Likewise. (mkPredList): Remove dead code.
Diffstat (limited to 'src/interp/i-util.boot')
-rw-r--r--src/interp/i-util.boot53
1 files changed, 1 insertions, 52 deletions
diff --git a/src/interp/i-util.boot b/src/interp/i-util.boot
index aafc33d1..73fe7ce2 100644
--- a/src/interp/i-util.boot
+++ b/src/interp/i-util.boot
@@ -145,59 +145,8 @@ makeInitialModemapFrame() ==
isCapitalWord x ==
(y := PNAME x) and and/[UPPER_-CASE_-P y.i for i in 0..MAXINDEX y]
-$newCompilerUnionFlag := true
-
-orderUnionEntries l ==
- $newCompilerUnionFlag => l
- first l is [":",.,.] => l -- new style Unions
- [a,b]:=
- split(l,nil,nil) where
- split(l,a,b) ==
- l is [x,:l'] =>
- (STRINGP x => split(l',[x,:a],b); split(l',a,[x,:b]))
- [a,b]
- [:orderList a,:orderList b]
-
mkPredList listOfEntries ==
- $newCompilerUnionFlag =>
- [['EQCAR,"#1",i] for arg in listOfEntries for i in 0..]
- first listOfEntries is [":",.,.] => -- new Tagged Unions
- [['EQCAR,"#1",MKQ tag] for [.,tag,.] in listOfEntries]
- --1. generate list of type-predicate pairs from union specification
- initTypePredList:=
- [selTypePred for x in listOfEntries] where
- selTypePred() ==
- STRINGP x => [x,'EQUAL,"#1",x]
- [x,:GETL(opOf x,"BasicPredicate")]
- typeList:= ASSOCLEFT initTypePredList
- initPredList:= ASSOCRIGHT initTypePredList
- hasDuplicatePredicate:=
- fn initPredList where
- fn x ==
- null x => false
- first x and member(first x,rest x) => true
- fn rest x
- --if duplicate predicate, kill them all
- if hasDuplicatePredicate then initPredList:= [nil for x in initPredList]
- nonEmptyPredList:= [p for p in initPredList | p^=nil]
- numberWithoutPredicate:= #listOfEntries-#nonEmptyPredList
- predList:=
- numberWithoutPredicate=0 and not hasDuplicatePredicate => initPredList
- numberWithoutPredicate=1 and null LAST initPredList and
- [STRINGP x for x in rest REVERSE listOfEntries] =>
- allButLast:= rest REVERSE initPredList
- NREVERSE [['NULL,MKPF(allButLast,"OR")],:allButLast]
- --otherwise, generate a tagged-union
- --we have made an even number of REVERSE operations, therefore
- --the original order is preserved. JHD 25.Sept.1983
- tagPredList:= [["EQCAR","#1",i] for i in 1..numberWithoutPredicate]
- [addPredIfNecessary for p in initPredList] where
- addPredIfNecessary() ==
- p => p
- [u,:tagPredList]:= tagPredList
- u
- predList
-
+ [['EQCAR,"#1",i] for arg in listOfEntries for i in 0..]
--%