diff options
-rw-r--r-- | src/interp/br-data.boot | 4 | ||||
-rw-r--r-- | src/interp/br-saturn.boot | 2 | ||||
-rw-r--r-- | src/interp/buildom.boot | 4 | ||||
-rw-r--r-- | src/interp/cattable.boot | 2 | ||||
-rw-r--r-- | src/interp/compiler.boot | 5 | ||||
-rw-r--r-- | src/interp/define.boot | 6 | ||||
-rw-r--r-- | src/interp/functor.boot | 2 | ||||
-rw-r--r-- | src/interp/g-util.boot | 9 | ||||
-rw-r--r-- | src/interp/i-map.boot | 2 |
9 files changed, 14 insertions, 22 deletions
diff --git a/src/interp/br-data.boot b/src/interp/br-data.boot index acdd25da..3c44428f 100644 --- a/src/interp/br-data.boot +++ b/src/interp/br-data.boot @@ -127,7 +127,7 @@ buildLibdbString [x,:u] == libConstructorSig [conname,:argl] == [[.,:sig],:.] := substitute("T","T$",getConstructorModemap conname) - formals := formalVarList #argl + formals := take(#argl,$FormalMapVariableList) sig := applySubst(pairList($TriangleVariableList,formals),sig) keys := [g(f,sig,i) for f in formals for i in 1..] where g(x,u,i) == --does x appear in any but i-th element of u? @@ -636,7 +636,7 @@ transKCatAlist(conform,domname,s) == main where --no domname, so look for special argument combinations acc := nil KDR conform => - farglist := formalVarList #rest conform + farglist := take(#rest conform,$FormalMapVariableList) for pair in s repeat --pair has form [con,[conargs,:pred],...]] leftForm := getConstructorForm first pair for (ap := [args,:pred]) in rest pair repeat diff --git a/src/interp/br-saturn.boot b/src/interp/br-saturn.boot index 9559cee7..6f55c992 100644 --- a/src/interp/br-saturn.boot +++ b/src/interp/br-saturn.boot @@ -1235,7 +1235,7 @@ displayDomainOp(htPage,which,origin,op,sig,predicate, --RDJ: this next line is necessary until compiler bug is fixed --that forgets to substitute #variables for t#variables; --check the signature for SegmentExpansionCategory, e.g. - tvarlist := tvarList # $conargs + tvarlist := take(# $conargs,$TriangleVariableList) $signature := applySubst(pairList(tvarlist,$FormalMapVariableList),$signature) $sig := which = '"attribute" or which = '"constructor" => sig diff --git a/src/interp/buildom.boot b/src/interp/buildom.boot index 6858bfaf..8ecf95f6 100644 --- a/src/interp/buildom.boot +++ b/src/interp/buildom.boot @@ -589,7 +589,7 @@ mkMappingFunList(nam,mapForm,e) == ++ Build an inline function for constructing records of length `n'. mkRecordFun n == - args := formalVarList n + args := take(n,$FormalMapVariableList) op := n < 2 => '%list n = 2 => '%pair @@ -611,7 +611,7 @@ eltRecordFun(n,i) == ["XLAM",["#1","#2"],formalRecordField(n,i)] seteltRecordFun(n,i) == - args := formalVarList 3 + args := take(3,$FormalMapVariableList) field := formalRecordField(n,i) body := n > 2 => ['%store,field,"#3"] diff --git a/src/interp/cattable.boot b/src/interp/cattable.boot index 21e61c26..7cb1dc0d 100644 --- a/src/interp/cattable.boot +++ b/src/interp/cattable.boot @@ -381,7 +381,7 @@ categoryParts(conform,category,:options) == main where if addCtor? then res := [listSort(function GLESSEQP,$conslist),:res] if getConstructorKindFromDB conname is "category" then - tvl := tvarList #rest conform + tvl := take(#rest conform,$TriangleVariableList) res := applySubst(pairList(tvl,$FormalMapVariableList),res) res build(item,pred) == diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index e9a97c6f..e070e214 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -334,8 +334,7 @@ compWithMappingMode(x,m is ["Mapping",m',:sl],oldE) == return [['%function,x],m,e] x is ["+->",:.] => compLambda(x,m,oldE) if string? x then x := makeSymbol x - vl := formalVarList #sl - for m in sl for v in vl repeat + for m in sl for v in (vl:= take(#sl,$FormalMapVariableList)) repeat [.,.,e]:= compMakeDeclaration(v,m,e) (vl ~= nil) and not hasFormalMapVariable(x, vl) => [u,.,.] := comp([x,:vl],m',e) or return nil @@ -1357,7 +1356,7 @@ compHas(pred is ["has",a,b],m,e) == compHasFormat(db,pred is ["has",olda,b],e) == argl := $form.args - formals := formalVarList #argl + formals := take(#argl,$FormalMapVariableList) a := applySubst(pairList(formals,argl),olda) [a,.,e] := comp(a,$EmptyMode,e) or return nil a := applySubst(pairList(argl,formals),a) diff --git a/src/interp/define.boot b/src/interp/define.boot index 580b22a8..187c3768 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -673,7 +673,7 @@ explodeIfs x == main where --called by getParentsFor getParentsFor db == constructorForm := dbConstructorForm db n := #constructorForm.args - s1 := pairList($TriangleVariableList,formalVarList n) + s1 := pairList(take(n,$TriangleVariableList),$FormalMapVariableList) s2 := pairList($FormalMapVariableList,constructorForm.args) [:explodeIfs applySubst(s2,applySubst(s1,x)) for x in folks dbCategory db] @@ -998,7 +998,7 @@ compDefineCategory1(db,df is ['DEF,form,sig,body],m,e,fal) == makeCategoryPredicates db == n := dbArity db - sl := pairList($TriangleVariableList,formalVarList n) + sl := pairList(take(n,$TriangleVariableList),take(n,rest $FormalMapVariableList)) fn(dbCategory db,sl,nil) where fn(u,sl,pl) == u is ['Join,:.,a] => fn(a,sl,pl) @@ -1132,7 +1132,7 @@ compDefineCategory2(db,form,signature,body,m,e,$formalArgList) == -- 3. replace arguments by $1,..., substitute into body, -- and introduce declarations into environment - sargl := tvarList #form.args + sargl := take(# form.args, $TriangleVariableList) $functorForm:= $form:= [$op,:sargl] $formalArgList:= [:sargl,:$formalArgList] formalBody := dbSubstituteFormals(db,body) diff --git a/src/interp/functor.boot b/src/interp/functor.boot index ec61ffd0..5aac19c4 100644 --- a/src/interp/functor.boot +++ b/src/interp/functor.boot @@ -354,7 +354,7 @@ DescendCodeAdd(db,base,flag) == modemap := get(base.op,'modemap,$CategoryFrame) modemap = nil => if getmode(base.op,$e) is ["Mapping",target,:formalArgModes] - then formalArgs := formalVarList #formalArgModes + then formalArgs := take(#formalArgModes,$FormalMapVariableList) --argument substitution if parameterized? else keyedSystemError("S2OR0001",[base.op]) diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index 3115c8f7..aeb05ece 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -1,6 +1,6 @@ -- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. -- All rights reserved. --- Copyright (C) 2007-2013, Gabriel Dos Reis. +-- Copyright (C) 2007-2012, Gabriel Dos Reis. -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without @@ -48,8 +48,6 @@ module g_-util where spliceSeqArgs: %List %Code -> %Code mkSeq: %List %Code -> %Code usesVariable?: (%Code,%Symbol) -> %Boolean - formalVarList: %Short -> %List %Symbol - tvarList: %Short -> %List %Symbol --% @@ -264,11 +262,6 @@ isSharpVarWithNum x == ok := digit? d => c := 10*c + DIG2FIX d if ok then c else nil -formalVarList n == - take(n,$FormalMapVariableList) - -tvarList n == - take(n,$TriangleVariableList) mkBuffer v == [copyVector v,:#v] diff --git a/src/interp/i-map.boot b/src/interp/i-map.boot index 89eefa93..ba4e1277 100644 --- a/src/interp/i-map.boot +++ b/src/interp/i-map.boot @@ -302,7 +302,7 @@ makePattern(args,pred) == pred is ["=","#1",n] => n addPatternPred("#1",pred) u:= canMakeTuple(nargs,pred) => u - addPatternPred(["tuple",:formalVarList nargs],pred) + addPatternPred(["tuple",:take(nargs,$FormalMapVariableList)],pred) addPatternPred(arg,pred) == pred=true => arg |