diff options
Diffstat (limited to 'src/interp/i-resolv.boot')
-rw-r--r-- | src/interp/i-resolv.boot | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/interp/i-resolv.boot b/src/interp/i-resolv.boot index dbd07152..e71472ae 100644 --- a/src/interp/i-resolv.boot +++ b/src/interp/i-resolv.boot @@ -154,7 +154,7 @@ resolveTTUnion(t1 is ['Union,:doms],t2) == for d in doms2 while not bad repeat d = '"failed" => ud := append(ud,[d]) null (d' := resolveTTUnion(t1,d)) => bad := true - ud := append(ud,CDR d') + ud := append(ud,rest d') bad => NIL ['Union,:REMDUP ud] @@ -165,7 +165,7 @@ resolveTTSpecial(t1,t2) == -- following is just an efficiency hack (t1 = $Symbol or t1 is ['OrderedVariableList,.]) and CONSP(t2) and - CAR(t2) in '(Polynomial RationalFunction) => t2 + first(t2) in '(Polynomial RationalFunction) => t2 (t1 = $Symbol) and ofCategory(t2, '(IntegerNumberSystem)) => resolveTT1(['Polynomial, t2], t2) @@ -277,10 +277,10 @@ resolveTTEq1(c1,arg1,TL is [c2,arg2,:.]) == c1=c2 and [c2,arg2,:TL] := bubbleType TL until null arg1 or null arg2 or not t repeat - t := resolveTT1(CAR arg1,CAR arg2) => + t := resolveTT1(first arg1,first arg2) => arg := CONS(t,arg) - arg1 := CDR arg1 - arg2 := CDR arg2 + arg1 := rest arg1 + arg2 := rest arg2 t and null arg1 and null arg2 and t0 := constructM(c1,nreverse arg) constructTowerT(t0,TL) @@ -345,7 +345,7 @@ resolveTTRed3(t) == interpOp?(op) == CONSP(op) and - CAR(op) in '(Incl SetDiff SetComp SetInter SetUnion VarEqual SetEqual) + first(op) in '(Incl SetDiff SetComp SetInter SetUnion VarEqual SetEqual) --% Resolve Type with Category @@ -413,7 +413,7 @@ getConditionalCategoryOfType(t,conditions,match) == if CONSP t then t := first t t in '(Union Mapping Record) => NIL conCat := getConstructorCategoryFromDB t - REMDUP CDR getConditionalCategoryOfType1(conCat,conditions,match,[NIL]) + REMDUP rest getConditionalCategoryOfType1(conCat,conditions,match,[NIL]) getConditionalCategoryOfType1(cat,conditions,match,seen) == cat is ['Join,:cs] or cat is ['CATEGORY,:cs] => @@ -423,12 +423,12 @@ getConditionalCategoryOfType1(cat,conditions,match,seen) == match,seen) cat is ['IF,., cond,.] => matchUpToPatternVars(cond,match,NIL) => - RPLACD(conditions,CONS(cat,CDR conditions)) + RPLACD(conditions,CONS(cat,rest conditions)) conditions conditions cat is [catName,:.] and (getConstructorKindFromDB catName = "category") => - member(cat, CDR seen) => conditions - RPLACD(seen,[cat,:CDR seen]) + member(cat, rest seen) => conditions + RPLACD(seen,[cat,:rest seen]) subCat := getConstructorCategoryFromDB catName -- substitute vars of cat into category for v in rest cat for vv in $TriangleVariableList repeat @@ -444,13 +444,13 @@ matchUpToPatternVars(pat,form,patAlist) == EQUAL(pat,form) => true isSharpVarWithNum(pat) => -- see is pattern variable is in alist - (p := assoc(pat,patAlist)) => EQUAL(form,CDR p) + (p := assoc(pat,patAlist)) => EQUAL(form,rest p) patAlist := [[pat,:form],:patAlist] true CONSP(pat) => atom form => NIL - matchUpToPatternVars(CAR pat, CAR form,patAlist) and - matchUpToPatternVars(CDR pat, CDR form,patAlist) + matchUpToPatternVars(first pat, first form,patAlist) and + matchUpToPatternVars(rest pat, rest form,patAlist) NIL --% Resolve Type with Mode @@ -486,9 +486,9 @@ resolveTM1(t,m) == isPatternVar m => p := ASSQ(m,$Subst) => $Coerce => - tt := resolveTT1(t,CDR p) => RPLACD(p,tt) and tt + tt := resolveTT1(t,rest p) => RPLACD(p,tt) and tt NIL - t=CDR p and t + t=rest p and t $Subst := CONS(CONS(m,t),$Subst) t atom(t) or atom(m) => NIL @@ -514,7 +514,7 @@ resolveTMRecord(tr,mr) == second(ta) ~= second(ma) => ok := NIL -- match tags ra := resolveTM1(third ta, third ma) -- resolve modes null ra => ok := NIL - tt := CONS([CAR ta,second ta,ra],tt) + tt := CONS([first ta,second ta,ra],tt) null ok => NIL ['Record,nreverse tt] @@ -544,7 +544,7 @@ resolveTMUnion(t, m is ['Union,:ums]) == doms := nil for ut in uts while not bad repeat (m' := resolveTMUnion(ut,['Union,:ums])) => - doms := append(CDR m',doms) + doms := append(rest m',doms) bad := true bad => NIL ['Union,:REMDUP doms] @@ -587,7 +587,7 @@ resolveTMEq(t,m) == t := argt and last argt b and t := resolveTMEq2(cm,argm,[ct,argt,:TL]) - if t then for p in SL repeat $Subst := augmentSub(CAR p,CDR p,$Subst) + if t then for p in SL repeat $Subst := augmentSub(first p,rest p,$Subst) t resolveTMSpecial(t,m) == @@ -616,25 +616,25 @@ resolveTMEq1(ct,cm) == -- ct and cm are type constructors -- tests for a match from cm to ct -- the result is a substitution or 'failed - not (CAR ct=CAR cm) => 'failed + not (first ct=first cm) => 'failed SL := NIL - ct := CDR ct - cm := CDR cm + ct := rest ct + cm := rest cm b := 'T while ct and cm and b repeat - xt := CAR ct - ct := CDR ct - xm := CAR cm - cm := CDR cm - if not (atom xm) and CAR xm = ":" -- i.e. Record - and CAR xt = ":" and second xm = second xt then + xt := first ct + ct := rest ct + xm := first cm + cm := rest cm + if not (atom xm) and first xm = ":" -- i.e. Record + and first xt = ":" and second xm = second xt then xm := third xm xt := third xt b := xt=xm => 'T isPatternVar(xm) and - p := ASSQ(xm,$Subst) => xt=CDR p - p := ASSQ(xm,SL) => xt=CDR p + p := ASSQ(xm,$Subst) => xt=rest p + p := ASSQ(xm,SL) => xt=rest p SL := augmentSub(xm,xt,SL) b => SL 'failed @@ -650,10 +650,10 @@ resolveTMEq2(cm,argm,TL) == -- null argm => NIL arg := NIL while argt and argm until not tt repeat - x1 := CAR argt - argt := CDR argt - x2 := CAR argm - argm := CDR argm + x1 := first argt + argt := rest argt + x2 := first argm + argm := rest argm tt := resolveTM1(x1,x2) => arg := CONS(tt,arg) null argt and null argm and tt and constructM(ct,nreverse arg) @@ -719,8 +719,8 @@ getUnderModeOf d == --deconstructM(t) == -- -- M is a type, which may contain type variables -- -- results in a pair (type constructor . mode arguments) --- CDR t and constructor? CAR t => --- dt := destructT CAR t +-- rest t and constructor? first t => +-- dt := destructT first t -- args := [ x for d in dt for y in t | ( x := d and y ) ] -- c := [ x for d in dt for y in t | ( x := not d and y ) ] -- CONS(c,args) @@ -738,14 +738,14 @@ deconstructT(t) == constructT(c,A) == -- c is a type constructor, A a list of argument types - A => [if d then POP A else POP c for d in destructT CAR c] + A => [if d then POP A else POP c for d in destructT first c] c constructM(c,A) == -- replaces top level RE's or QF's by equivalent types, if possible containsVars(c) or containsVars(A) => NIL -- collapses illegal FE's - CAR(c) = $FunctionalExpression => eqType defaultTargetFE CAR A + first(c) = $FunctionalExpression => eqType defaultTargetFE first A eqType constructT(c,A) replaceLast(A,t) == |