diff options
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/buildom.boot | 6 | ||||
-rw-r--r-- | src/interp/compiler.boot | 6 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/src/interp/buildom.boot b/src/interp/buildom.boot index ce70aa08..b2b5c8c3 100644 --- a/src/interp/buildom.boot +++ b/src/interp/buildom.boot @@ -351,7 +351,7 @@ mkNewUnionFunList(name,form is ["Union",:listOfEntries],e) == [[["construct",[name,type],["XLAM",["#1"],["%makepair",i,"#1"]]], ["elt",[type,name,tag],cdownFun], ["case",[$Boolean,name,tag], - ["XLAM",["#1"],['%ieq,['%head,"#1"],i]]]] + ["XLAM",["#1","#2"],['%ieq,['%head,"#1"],i]]]] for [.,tag,type] in listOfEntries for i in 0..])] where cdownFun() == gg:=gensym() @@ -413,8 +413,8 @@ mkUnionFunList(op,form is ["Union",:listOfEntries],e) == ["XLAM",["#1"],"#1"] typeFun() == p is ['%ieq,['%head,x],n] => - ["XLAM",["#1"],['%ieq,['%head,x],n]] - ["XLAM",["#1"],p] + ["XLAM",["#1","#2"],['%ieq,['%head,x],n]] + ["XLAM",["#1","#2"],p] cList:= substitute(dollarIfRepHack op,g,cList) [cList,e] diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 597e07cb..9f7976cb 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1529,10 +1529,8 @@ compCase1(x,m,e) == and modeEqual(s,m')] or return nil fn:= (or/[mm for (mm := [.,[cond,selfn]]) in u | cond=true]) or return nil fn := genDeltaEntry(["case",:fn],e) - -- user-defined `case' functions really are binary, as opposed to - -- the compiler-synthetized versions for Union instances. - not isUnionMode(m',e') => [['%call,fn,x',MKQ m],$Boolean,e'] - [['%call,fn,x'],$Boolean,e'] + [['%call,fn,x',MKQ m],$Boolean,e'] + ++ For `case' operation implemented in library, the second operand diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index 08683f80..d18899dc 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -312,7 +312,7 @@ optCond (x is ['%when,:l]) == optCond ['%when,[['%or,p1,p2],:c1],['%otherwise,:c3]] x for y in tails l repeat - c := first c + c := first y if c is [['%not,['%not,p]],:.] then c.first := p while y is [[a1,c1],[a2,c2],:y'] and EqualBarGensym(c1,c2) repeat |