From 844be40b5b876fffd816f285f87711cca6ef3121 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sat, 3 Jan 2009 01:35:30 +0000 Subject: * 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. --- src/interp/i-util.boot | 53 +------------------------------------------------- 1 file changed, 1 insertion(+), 52 deletions(-) (limited to 'src/interp/i-util.boot') 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..] --% -- cgit v1.2.3