diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/boot/utility.boot | 25 | ||||
-rw-r--r-- | src/interp/c-util.boot | 23 | ||||
-rw-r--r-- | src/interp/category.boot | 37 | ||||
-rw-r--r-- | src/interp/compiler.boot | 24 | ||||
-rw-r--r-- | src/interp/database.boot | 7 | ||||
-rw-r--r-- | src/interp/define.boot | 37 | ||||
-rw-r--r-- | src/interp/functor.boot | 26 | ||||
-rw-r--r-- | src/interp/g-cndata.boot | 5 | ||||
-rw-r--r-- | src/interp/modemap.boot | 26 | ||||
-rw-r--r-- | src/interp/msg.boot | 2 |
10 files changed, 110 insertions, 102 deletions
diff --git a/src/boot/utility.boot b/src/boot/utility.boot index 026bcc04..6ee1e180 100644 --- a/src/boot/utility.boot +++ b/src/boot/utility.boot @@ -39,22 +39,27 @@ objectMember?(x,l) == cons? l => sameObject?(x,first l) or objectMember?(x,rest l) sameObject?(x,l) -genericMember?(x,l,p) == +symbolMember?(s,l) == l = nil => false - cons? l => apply(p,x,first l,nil) or genericMember?(x,rest l,p) - apply(p,x,l,nil) - -symbolMember?(x,l) == - genericMember?(x,l,function symbolEq?) + cons? l => symbolEq?(s,first l) or symbolMember?(s,rest l) + symbolEq?(s,l) stringMember?(s,l) == - genericMember?(s,l,function stringEq?) + l = nil => false + cons? l => stringEq?(s,first l) or stringMember?(s,rest l) + stringEq?(s,l) charMember?(c,l) == - genericMember?(c,l,function charEq?) + l = nil => false + cons? l => charEq?(c,first l) or charMember?(c,rest l) + charEq?(c,l) scalarMember?(x,l) == - genericMember?(x,l,function scalarEq?) + l = nil => false + cons? l => scalarEq?(x,first l) or scalarMember?(x,rest l) + charEq?(x,l) listMember?(x,l) == - genericMember?(x,l,function listEq?) + l = nil => false + cons? l => listEq?(x,first l) or listMember?(x,rest l) + listEq?(x,l) diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index 8b94b4e9..5b23299a 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -368,7 +368,7 @@ intersectionContour(c,c') == m2 is ["Union",:.] => ["Union",:S_+(rest m2,[m1])] ["Union",m1,m2] for u in getDomainsInScope $e repeat - if u is ["Union",:u'] and (and/[member(v,u') for v in rest m]) then + if u is ["Union",:u'] and (and/[listMember?(v,u') for v in rest m]) then return m --this loop will return NIL if not satisfied @@ -455,7 +455,7 @@ unionLike?(m,e) == T.mode is ['UnionCategory,:.] => T.mode T.mode is ['UnionType] => ['UnionCategory] T.mode isnt ['Join,:cats,['CATEGORY,.,:sigs]] => nil - member(['UnionType],cats) => + listMember?(['UnionType],cats) => ['UnionCategory, :[b for ['SIGNATURE,"case",[=$Boolean,'$,["[||]",b]]] in sigs]] nil @@ -470,7 +470,7 @@ getInverseEnvironment(a,e) == a is ["case",x,m] and (x := lhsOfAssignment x) and IDENTP x => --the next two lines are necessary to get 3-branched Unions to work -- old-style unions, that is - (get(x,"condition",e) is [["OR",:oldpred]]) and member(a,oldpred) => + (get(x,"condition",e) is [["OR",:oldpred]]) and listMember?(a,oldpred) => put(x,"condition",[MKPF(delete(a,oldpred),"OR")],e) unionProperty(x,e) is ['UnionCategory,:l] => l':= delete(m,l) @@ -524,7 +524,7 @@ prModemaps E == listOfOperatorsSeenSoFar:= nil for x in E for i in 1.. repeat for y in x for j in 1.. repeat - for z in y | null member(first z,listOfOperatorsSeenSoFar) and + for z in y | not member(first z,listOfOperatorsSeenSoFar) and (modemap:= LASSOC("modemap",rest z)) repeat listOfOperatorsSeenSoFar:= [first z,:listOfOperatorsSeenSoFar] TERPRI() @@ -696,7 +696,7 @@ isSimple x == isSideEffectFree op == op is ["elt",.,op'] => isSideEffectFree op' not IDENTP op => false - member(op,$SideEffectFreeFunctionList) or constructor? op + listMember?(op,$SideEffectFreeFunctionList) or constructor? op isAlmostSimple x == --returns (<new predicate> . <list of assignments>) or nil @@ -804,7 +804,7 @@ stackSemanticError(msg,expr) == if $insideCapsuleFunctionIfTrue then msg:= [$op,": ",:msg] if atom msg then msg:= [msg] entry:= [msg,expr] - if not member(entry,$semanticErrorStack) then $semanticErrorStack:= + if not listMember?(entry,$semanticErrorStack) then $semanticErrorStack:= [entry,:$semanticErrorStack] $scanIfTrue and $insideCapsuleFunctionIfTrue=true and #$semanticErrorStack- $initCapsuleErrorCount>3 => THROW("compCapsuleBody",nil) @@ -813,7 +813,8 @@ stackSemanticError(msg,expr) == stackWarning(msg,args == nil) == msg := buildMessage(msg, args) if $insideCapsuleFunctionIfTrue then msg:= [$op,": ",:msg] - if not member(msg,$warningStack) then $warningStack:= [msg,:$warningStack] + if not listMember?(msg,$warningStack) then + $warningStack:= [msg,:$warningStack] nil unStackWarning(msg,args) == @@ -884,7 +885,7 @@ extendsCategoryForm(domain,form,form') == extendsCategoryForm(domain,form,cat) and isSubset(domain,dom,$e) form is ["Join",:l] => or/[extendsCategoryForm(domain,x,form') for x in l] form is ["CATEGORY",.,:l] => - member(form',l) or + listMember?(form',l) or stackWarning('"not known that %1 is of mode %2p",[form',form]) or true -- if we are compiling the category `form', then we should look at -- the body as provided in the current definition, not a version @@ -908,8 +909,8 @@ extendsCategoryForm(domain,form,form') == -- Are we dealing with an Aldor category? If so use the "has" function ... # formVec = 1 => newHasTest(form,form') catvlist:= formVec.4 - member(form',first catvlist) or - member(form',SUBSTQ(domain,"$",first catvlist)) or + listMember?(form',first catvlist) or + listMember?(form',SUBSTQ(domain,"$",first catvlist)) or (or/ [extendsCategoryForm(domain,SUBSTQ(domain,"$",cat),form') for [cat,:.] in second catvlist]) @@ -1001,7 +1002,7 @@ displayModemaps E == listOfOperatorsSeenSoFar:= nil for x in E for i in 1.. repeat for y in x for j in 1.. repeat - for z in y | null member(first z,listOfOperatorsSeenSoFar) and + for z in y | not member(first z,listOfOperatorsSeenSoFar) and (modemaps:= LASSOC("modemap",rest z)) repeat listOfOperatorsSeenSoFar:= [first z,:listOfOperatorsSeenSoFar] displayOpModemaps(first z,modemaps) diff --git a/src/interp/category.boot b/src/interp/category.boot index 79640445..c562a43c 100644 --- a/src/interp/category.boot +++ b/src/interp/category.boot @@ -221,10 +221,10 @@ mkOr(a,b) == DescendantP(acat,bcat) => [b] DescendantP(bcat,acat) => [a] [a,b] - a is ['AND,:a'] and member(b,a') => [b] - b is ['AND,:b'] and member(a,b') => [a] - a is ["and",:a'] and member(b,a') => [b] - b is ["and",:b'] and member(a,b') => [a] + a is ['AND,:a'] and listMember?(b,a') => [b] + b is ['AND,:b'] and listMember?(a,b') => [a] + a is ["and",:a'] and listMember?(b,a') => [b] + b is ["and",:b'] and listMember?(a,b') => [a] [a,b] #l = 1 => first l ["OR",:l] @@ -232,7 +232,7 @@ mkOr(a,b) == mkOr2: (%Form,%Form) -> %Form mkOr2(a,b) == --a is a condition, "b" a list of them - member(a,b) => b + listMember?(a,b) => b a is ["has",avar,acat] => aRedundant:=false for c in b | c is ["has",=avar,ccat] repeat @@ -264,7 +264,7 @@ mkAnd(a,b) == mkAnd2: (%Form,%Form) -> %Form mkAnd2(a,b) == --a is a condition, "b" a list of them - member(a,b) => b + listMember?(a,b) => b a is ["has",avar,acat] => aRedundant:=false for c in b | c is ["has",=avar,ccat] repeat @@ -313,7 +313,7 @@ MachineLevelSubsume([name1,[out1,:in1],:flag1],[name2,[out2,:in2],:flag2]) == MachineLevelSubset(a,b) == --true if a is a machine-level subset of b a=b => true - b is ["Union",:blist] and member(a,blist) and + b is ["Union",:blist] and listMember?(a,blist) and (and/[string? x for x in blist | x~=a]) => true --all other branches must be distinct objects not null isSubDomain(a,b) @@ -364,9 +364,9 @@ CatEval x == AncestorP: (%Form, %List) -> %Form AncestorP(xname,leaves) == -- checks for being a principal ancestor of one of the leaves - member(xname,leaves) => xname + listMember?(xname,leaves) => xname for y in leaves repeat - member(xname,first CatEval(y).4) => return y + listMember?(xname,first CatEval(y).4) => return y CondAncestorP(xname,leaves,condition) == -- checks for being a principal ancestor of one of the leaves @@ -375,7 +375,7 @@ CondAncestorP(xname,leaves,condition) == ucond:= null rest u => true second u - xname = u' or member(xname,first CatEval(u').4) => + xname = u' or listMember?(xname,first CatEval(u').4) => PredImplies(ucond,condition) => return u' @@ -389,7 +389,7 @@ DescendantP(a,b) == a:= CatEval a b is ["ATTRIBUTE",b'] => (l:=assoc(b',a.2)) => TruthP second l - member(b,first a.4) => true + listMember?(b,first a.4) => true AncestorP(b,[first u for u in second a.4]) => true false @@ -410,12 +410,13 @@ JoinInner(l,$e) == nil pred:= second at -- The predicate under which this category is conditional - member(pred,get("$Information","special",$e)) => l:= [:l,CatEval at2] + listMember?(pred,get("$Information","special",$e)) => + l:= [:l,CatEval at2] --It's true, so we add this as unconditional not (pred is ["and",:.]) => CondList:= [[CatEval at2,pred],:CondList] pred':= [u - for u in rest pred | not member(u,get("$Information","special",$e)) + for u in rest pred | not listMember?(u,get("$Information","special",$e)) and not (u=true)] null pred' => l:= [:l,CatEval at2] # pred'=1 => CondList:= [[CatEval at2,pred'],:CondList] @@ -450,7 +451,7 @@ JoinInner(l,$e) == --Principal Ancestors of b reallynew:= true for anc in FundamentalAncestors repeat - if member(first anc,PrinAncb) then + if listMember?(first anc,PrinAncb) then --This is the check for "Category Subsumption" if rest anc then (anccond:= second anc; ancindex:= third anc) @@ -467,7 +468,7 @@ JoinInner(l,$e) == then --the new 'b' is less often true newentry:=[bname,condition,ancindex] - if not member(newentry,FundamentalAncestors) then + if not listMember?(newentry,FundamentalAncestors) then FundamentalAncestors:= [newentry,:FundamentalAncestors] else ancindex:= nil if not copied then @@ -496,13 +497,13 @@ JoinInner(l,$e) == -- bCond:= second bCond globalDomains:= $NewCatVec.5 for u in $NewCatVec.1 repeat - if not member(u,sigl) then + if not listMember?(u,sigl) then [s,c,i]:= u if c=true then sigl:= [[s,condition,i],:sigl] else sigl:= [[s,["and",condition,c],i],:sigl] for u in $NewCatVec.2 repeat - if not member(u,attl) then + if not listMember?(u,attl) then [a,c]:= u if c=true then attl:= [[a,condition],:attl] @@ -554,7 +555,7 @@ JoinInner(l,$e) == --strip out the pointer to Principal Ancestor c:= first $NewCatVec.4 pName:= $NewCatVec.0 - if pName and not member(pName,c) then c:= [pName,:c] + if pName and not listMember?(pName,c) then c:= [pName,:c] $NewCatVec.4:= [c,FundamentalAncestors,third $NewCatVec.4] mkCategory("domain",sigl,attl,globalDomains,$NewCatVec) diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 1e214111..e792c690 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -195,7 +195,7 @@ comp3(x,m,$e) == not ($insideCompTypeOf=true) and stringPrefix?('"TypeOf",PNAME op) => compTypeOf(x,m,e) t:= compExpression(x,m,e) - t is [x',m',e'] and not member(m',getDomainsInScope e') => + t is [x',m',e'] and not listMember?(m',getDomainsInScope e') => [x',m',addDomain(m',e')] t @@ -397,7 +397,7 @@ compAtom(x,m,e) == T := IDENTP x and compAtomWithModemap(x,m,e,get(x,"modemap",e)) => T t := IDENTP x => compSymbol(x,m,e) or return nil - member(m,$IOFormDomains) and primitiveType x => [x,m,e] + listMember?(m,$IOFormDomains) and primitiveType x => [x,m,e] string? x => [x,x,e] [x,primitiveType x or return nil,e] convert(t,m) @@ -428,7 +428,7 @@ compSymbol(s,m,e) == [s,m',e] --s is a declared argument symbolMember?(s,$FormalMapVariableList) => stackMessage('"no mode found for %1b",[s]) - member(m,$IOFormDomains) or member(m,[$Identifier,$Symbol]) => + listMember?(m,$IOFormDomains) or member(m,[$Identifier,$Symbol]) => [['QUOTE,s],m,e] not isFunction(s,e) => errorRef s @@ -962,7 +962,7 @@ compQuote(expr,m,e) == expr is ["QUOTE",x] and IDENTP x => -- Ideally, Identifier should be the default type. However, for -- historical reasons we cannot afford that luxury yet. - m = $Identifier or member(m,$IOFormDomains) => [expr,m,e] + m = $Identifier or listMember?(m,$IOFormDomains) => [expr,m,e] coerce([expr,$Symbol,e],m) stackAndThrow('"%1b is not a literal symbol.",[x]) @@ -1355,7 +1355,7 @@ getFFIDatatype: %Mode -> %Form getFFIDatatype t == x := getBasicFFIType t => x t is [m,["PrimitiveArray",t']] and m in $FFITypeModifier and - member(t',$FFIAggregableDataType) => + listMember?(t',$FFIAggregableDataType) => m' := m = "ReadOnly" => bootDenotation "readonly" m = "WriteOnly" => bootDenotation "writeonly" @@ -1538,7 +1538,7 @@ compColon([":",f,t],m,e) == t:= atom t and (t':= assoc(t,getDomainsInScope e)) => t' isDomainForm(t,e) and not $insideCategoryIfTrue => - (if not member(t,getDomainsInScope e) then e:= addDomain(t,e); t) + (if not listMember?(t,getDomainsInScope e) then e:= addDomain(t,e); t) isDomainForm(t,e) or isCategoryForm(t,e) => t t is ["Mapping",m',:r] => t string? t => t -- literal flag types are OK @@ -1662,7 +1662,7 @@ commonSuperType(m,m') == lineage := [t,:lineage] m' := t while m ~= nil repeat - member(m,lineage) => return m + listMember?(m,lineage) => return m m := superType m ++ Coerce value `x' of mode `m' to mode `m'', if m is a subset of @@ -1700,12 +1700,12 @@ coerceExtraHard: (%Triple,%Mode) -> %Maybe %Triple coerceExtraHard(T is [x,m',e],m) == -- Allow implicit injection into Union, if that is -- clear from the context - isUnionMode(m,e) is ['Union,:l] and member(m',l) => + isUnionMode(m,e) is ['Union,:l] and listMember?(m',l) => autoCoerceByModemap(T,m) -- For values from domains satisfying Union-like properties, apply -- implicit retraction if clear from context. (t := hasType(x,e)) and unionLike?(m',e) is ['UnionCategory,:l] - and member(t,l) => + and listMember?(t,l) => T' := autoCoerceByModemap(T,t) => coerce(T',m) nil -- Give it one last chance. @@ -1793,7 +1793,7 @@ autoCoerceByModemap([x,source,e],target) == and modeEqual(s,source)] or return nil fn := (or/[mm for mm in u | mm.mmCondition=true]) or return nil - source is ["Union",:l] and member(target,l) => + source is ["Union",:l] and listMember?(target,l) => (y:= get(x,"condition",e)) and (or/[u is ["case",., =target] for u in y]) => [['%call,genDeltaEntry(["autoCoerce", :fn],e),x],target,e] x="$fromCoerceable$" => nil @@ -1930,7 +1930,7 @@ compMapCond'(cexpr,dc) == --stackSemanticError(("not known that",'"%b",name, -- '"%d","has",'"%b",cat,'"%d"),nil) --now it must be an attribute - member(["ATTRIBUTE",dc,cexpr],get("$Information","special",$e)) => true + listMember?(["ATTRIBUTE",dc,cexpr],get("$Information","special",$e)) => true --for the time being we'll stop here - shouldn't happen so far stackMessage('"not known that %1pb has %2pb",[dc,cexpr]) false @@ -2369,7 +2369,7 @@ compRepeatOrCollect(form,m,e) == -- [['%call,fn,x],target,e] listOrVectorElementMode x == - x is [a,b,:.] and member(a,'(PrimitiveArray Vector List)) => b + x is [a,b,:.] and symbolMember?(a,'(PrimitiveArray Vector List)) => b ++ Return the least Integer subdomain that can represent values ++ of both Integer subdomains denoted by the forms `x' and `y. diff --git a/src/interp/database.boot b/src/interp/database.boot index 2f5d862c..680d7334 100644 --- a/src/interp/database.boot +++ b/src/interp/database.boot @@ -183,7 +183,7 @@ augLisplibModemapsFromCategory(form is [op,:argl],body,signature) == isCategoryForm(m,$EmptyEnvironment)] catPredList:= [['ofCategory,:u] for u in [["*1",form],:domainList]] for (entry:= [[op,sig,:.],pred,sel]) in opAlist | - member(sig,LASSOC(op,nonCategorySigAlist)) repeat + listMember?(sig,LASSOC(op,nonCategorySigAlist)) repeat pred':= MKPF([pred,:catPredList],'AND) modemap:= [["*1",:sig],[pred',sel]] $lisplibModemapAlist:= @@ -201,7 +201,7 @@ augmentLisplibModemapsFromFunctor(form,opAlist,signature) == nonCategorySigAlist:= mkAlistOfExplicitCategoryOps first signature or return nil for (entry:= [[op,sig,:.],pred,sel]) in opAlist | - or/[member(sig,catSig) for catSig in + or/[listMember?(sig,catSig) for catSig in allLASSOCs(op,nonCategorySigAlist)] repeat skip:= argl and CONTAINED("$",rest sig) => 'SKIP @@ -692,7 +692,8 @@ getOplistWithUniqueSignatures(op,pairlis,signatureAlist) == --% Exposure Group Code dropPrefix(fn) == - member(fn.0,[char "?",char "-",char "+"]) => subString(fn,1) + charMember?(stringChar(fn,0),[char "?",char "-",char "+"]) => + subString(fn,1) fn --moved to util.lisp diff --git a/src/interp/define.boot b/src/interp/define.boot index db663018..eb9ab532 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -216,12 +216,12 @@ orderBySubsumption items == if null second u then u := [first u,1] --mark as missing operation y := [[a,'Subsumed],u,:y] --makes subsuming signature follow one subsumed z := insert(b,z) --mark a signature as already present - [:y,:[w for (w := [c,:.]) in acc | not member(c,z)]] --add those not subsuming + [:y,:[w for (w := [c,:.]) in acc | not listMember?(c,z)]] --add those not subsuming makeCompactSigCode sig == [fn for x in sig] where fn() == - x = "$$" => 2 - x = "$" => 0 + x is "$$" => 2 + x is "$" => 0 not integer? x => systemError ['"code vector slot is ",x,'"; must be number"] x @@ -336,7 +336,7 @@ extendsCategoryBasic(dom,u,v) == v is ['SIGNATURE,op,sig] => or/[vectorRef(uVec,i) is [[=op,=sig],:.] for i in 6..maxIndex uVec] u is ['CATEGORY,.,:l] => - v is ['IF,:.] => member(v,l) + v is ['IF,:.] => listMember?(v,l) nil nil @@ -345,7 +345,7 @@ catExtendsCat?(u,v,uvec) == uvec := uvec or (compMakeCategoryObject(u,$EmptyEnvironment)).expr slot4 := vectorRef(uvec,4) prinAncestorList := first slot4 - member(v,prinAncestorList) => true + listMember?(v,prinAncestorList) => true vOp := KAR v if similarForm := assoc(vOp,prinAncestorList) then PRINT u @@ -415,7 +415,7 @@ $capsuleFunctions := nil ++ `pred' is defined in the current capsule of the current domain ++ being compiled. noteCapsuleFunctionDefinition(op,sig,pred) == - member([op,sig,pred],$capsuleFunctions) => + listMember?([op,sig,pred],$capsuleFunctions) => stackAndThrow('"redefinition of %1b: %2 %3", [op,formatUnabbreviated ["Mapping",:sig],formatIf pred]) $capsuleFunctions := [[op,sig,pred],:$capsuleFunctions] @@ -435,7 +435,7 @@ noteExport(form,pred) == -- them when defining the category. Plus, we might actually -- get indirect duplicates, which is OK. $insideCategoryPackageIfTrue => nil - member([form,pred],$exports) => + listMember?([form,pred],$exports) => stackAndThrow('"redeclaration of %1 %2", [form,formatIf pred]) $exports := [[form,pred],:$exports] @@ -1075,7 +1075,7 @@ displayMissingFunctions() == loc := nil -- list of local operation signatures exp := nil -- list of exported operation signatures for [[op,sig,:.],:pred] in $CheckVectorList | not pred repeat - not member(op,$formalArgList) and getmode(op,$e) is ['Mapping,:.] => + not symbolMember?(op,$formalArgList) and getmode(op,$e) is ['Mapping,:.] => loc := [[op,sig],:loc] exp := [[op,sig],:exp] if loc then @@ -1139,7 +1139,7 @@ genDomainOps(viewName,dom,cat) == for [op,sig] in siglist]]]] $getDomainCode:= [cd,:$getDomainCode] for [opsig,cond,:.] in oplist for i in 0.. repeat - if member(opsig,$ConditionalOperators) then cond:=nil + if listMember?(opsig,$ConditionalOperators) then cond:=nil [op,sig]:=opsig $e:= addModemap(op,dom,sig,cond,['ELT,viewName,i],$e) viewName @@ -1151,7 +1151,7 @@ genDomainView(viewName,originalName,c,viewSelector) == c $e:= augModemapsFromCategory(originalName,viewName,nil,c,$e) cd:= ["%LET",viewName,[viewSelector,originalName,mkTypeForm code]] - if not member(cd,$getDomainCode) then + if not listMember?(cd,$getDomainCode) then $getDomainCode:= [cd,:$getDomainCode] viewName @@ -1250,9 +1250,10 @@ orderByDependency(vl,dl) == [v for v in vl for d in dl | null intersection(d,vl)] or return nil orderedVarList:= [:newl,:orderedVarList] vl':= setDifference(vl,newl) - dl':= [setDifference(d,newl) for x in vl for d in dl | member(x,vl')] - vl:= vl' - dl:= dl' + dl':= [setDifference(d,newl) for x in vl for d in dl + | symbolMember?(x,vl')] + vl := vl' + dl := dl' removeDuplicates nreverse orderedVarList --ordered so ith is indep. of jth if i < j compDefineCapsuleFunction(df is ['DEF,form,signature,specialCases,body], @@ -1315,7 +1316,7 @@ compDefineCapsuleFunction(df is ['DEF,form,signature,specialCases,body], rettype:= resolve(signature'.target,$returnMode) localOrExported := - not member($op,$formalArgList) and + not symbolMember?($op,$formalArgList) and getmode($op,e) is ['Mapping,:.] => 'local 'exported @@ -1323,7 +1324,7 @@ compDefineCapsuleFunction(df is ['DEF,form,signature,specialCases,body], -- could be moved closer to the top formattedSig := formatUnabbreviated ['Mapping,:signature'] $compileOnlyCertainItems and _ - not member($op, $compileOnlyCertainItems) => + not symbolMember?($op, $compileOnlyCertainItems) => sayBrightly ['" skipping ", localOrExported,:bright $op] [nil,['Mapping,:signature'],$e] sayBrightly ['" compiling ",localOrExported, @@ -1499,7 +1500,7 @@ compile u == encodeFunctionName(op,$functorForm,$signatureOfForm,";",$suffix) where isLocalFunction op == - null member(op,$formalArgList) and + null symbolMember?(op,$formalArgList) and getmode(op,$e) is ['Mapping,:.] u:= [op',lamExpr] -- If just updating certain functions, check for previous existence. @@ -1765,7 +1766,7 @@ doIt(item,$predl) == item.first := first code item.rest := rest code lhs:= lhs' - if not member(KAR rhs,$NonMentionableDomainNames) and + if not symbolMember?(KAR rhs,$NonMentionableDomainNames) and not symbolMember?(lhs, $functorLocalParameters) then $functorLocalParameters:= [:$functorLocalParameters,lhs] if code is ["%LET",.,rhs',:.] and isDomainForm(rhs',$e) then @@ -1953,7 +1954,7 @@ DomainSubstitutionFunction(parameters,body) == atom body => symbolMember?(body,parameters) => MKQ body body - member(body,parameters) => + listMember?(body,parameters) => g:=gensym() $extraParms:=PUSH([g,:body],$extraParms) --Used in SetVector12 to generate a substitution list diff --git a/src/interp/functor.boot b/src/interp/functor.boot index cc576cbb..48d3277f 100644 --- a/src/interp/functor.boot +++ b/src/interp/functor.boot @@ -654,7 +654,7 @@ InvestigateConditions catvecListMaker == if not TruthP(cond:=second u) then new:=['CATEGORY,'domain,['IF,cond,['ATTRIBUTE,first u], '%noBranch]] $principal is ['Join,:l] => - not member(new,l) => + not listMember?(new,l) => $principal:=['Join,:l,new] $principal:=['Join,$principal,new] principal' := @@ -663,7 +663,8 @@ InvestigateConditions catvecListMaker == atom a => a a is ['SIGNATURE,:.] => a a is ['IF,cond,:.] => - if not member(cond,$Conditions) then $Conditions:= [cond,:$Conditions] + if not listMember?(cond,$Conditions) then + $Conditions:= [cond,:$Conditions] nil [pessimise first a,:pessimise rest a] null $Conditions => [true,:[true for u in secondaries]] @@ -671,7 +672,7 @@ InvestigateConditions catvecListMaker == MinimalPrimary:= first first PrincipalSecondaries MaximalPrimary:= CAAR $domainShell.4 necessarySecondaries:= [first u for u in PrincipalSecondaries | rest u=true] - and/[member(u,necessarySecondaries) for u in secondaries] => + and/[listMember?(u,necessarySecondaries) for u in secondaries] => [true,:[true for u in secondaries]] $HackSlot4:= MinimalPrimary=MaximalPrimary => nil @@ -696,11 +697,9 @@ InvestigateConditions catvecListMaker == masterSecondaries:= secondaries for u in partList repeat for [v,:.] in u repeat - if not member(v,secondaries) then secondaries:= [v,:secondaries] - (list:= [mkNilT member(u,necessarySecondaries) for u in secondaries]) where - mkNilT u == - u => true - nil + if not listMember?(v,secondaries) then + secondaries:= [v,:secondaries] + list:= [listMember?(u,necessarySecondaries) for u in secondaries] for u in $Conditions for newS in partList repeat --newS is a list of secondaries and conditions (over and above --u) for which they apply @@ -737,15 +736,16 @@ InvestigateConditions catvecListMaker == ['delete,['QUOTE,first u],'(CAAR TrueDomain)]]]] $supplementaries:= [u - for u in list | not member(first u,masterSecondaries) - and not (true=rest u) and not member(first u,pv)] + for u in list | not listMember?(first u,masterSecondaries) + and not (true=rest u) and not listMember?(first u,pv)] [true,:[LASSOC(ms,list) for ms in masterSecondaries]] ICformat u == atom u => u u is ["has",:.] => compHasFormat u u is ['AND,:l] or u is ['and,:l] => - l:= removeDuplicates [ICformat v for [v,:l'] in tails l | not member(v,l')] + l:= removeDuplicates [ICformat v for [v,:l'] in tails l + | not listMember?(v,l')] -- we could have duplicates after, even if not before # l=1 => first l l1:= first l @@ -782,7 +782,7 @@ ICformat u == for u in l | u is ['AND,:.] or u is ['and,:.] repeat --check that B causes (and A B) to go for v in l | not (v=u) repeat - if member(v,u) or (and/[member(w,u) for w in v]) then l:= + if listMember?(v,u) or (and/[member(w,u) for w in v]) then l:= delete(u,l) --v subsumes u --Note that we are ignoring AND as a component. @@ -792,7 +792,7 @@ ICformat u == partPessimise(a,trueconds) == atom a => a a is ['SIGNATURE,:.] => a - a is ['IF,cond,:.] => (member(cond,trueconds) => a; nil) + a is ['IF,cond,:.] => (listMember?(cond,trueconds) => a; nil) [partPessimise(first a,trueconds),:partPessimise(rest a,trueconds)] getPossibleViews u == diff --git a/src/interp/g-cndata.boot b/src/interp/g-cndata.boot index 52d2040a..d90b5ef3 100644 --- a/src/interp/g-cndata.boot +++ b/src/interp/g-cndata.boot @@ -169,9 +169,8 @@ isNameOfType x == $doNotAddEmptyModeIfTrue:local:= true (val := get(x,'value,$InteractiveFrame)) and (domain := objMode val) and - member(domain,$LangSupportTypes) => true - y := opOf unabbrev x - constructor? y + listMember?(domain,$LangSupportTypes) => true + constructor? opOf unabbrev x unabbrev1(u,modeIfTrue) == atom u => diff --git a/src/interp/modemap.boot b/src/interp/modemap.boot index f6e9b10f..6abd17c2 100644 --- a/src/interp/modemap.boot +++ b/src/interp/modemap.boot @@ -174,7 +174,7 @@ addModemap1(op,mc,sig,pred,fn,e) == mkNewModemapList(mc,sig,pred,fn,curModemapList,e,filenameOrNil) == entry:= [map:= [mc,:sig],[pred,fn],:filenameOrNil] - member(entry,curModemapList) => curModemapList + listMember?(entry,curModemapList) => curModemapList (oldMap:= assoc(map,curModemapList)) and oldMap is [.,[opred, =fn],:.] => $forceAdd => mergeModemap(entry,curModemapList,e) opred=true => curModemapList @@ -226,9 +226,9 @@ addNewDomain(domain,e) == augModemapsFromDomain(domain,domain,e) augModemapsFromDomain(name,functorForm,e) == - member(KAR name or name,$DummyFunctorNames) => e + symbolMember?(KAR name or name,$DummyFunctorNames) => e name=$Category or isCategoryForm(name,e) => e - member(name,curDomainsInScope:= getDomainsInScope e) => e + listMember?(name,curDomainsInScope:= getDomainsInScope e) => e if super := superType functorForm then e := addNewDomain(super,e) if innerDom:= listOrVectorElementMode name then e:= addDomain(innerDom,e) @@ -370,7 +370,7 @@ getDomainsInScope e == putDomainsInScope(x,e) == l:= getDomainsInScope e - if $verbose and member(x,l) then + if $verbose and listMember?(x,l) then sayBrightly ['" Note: Domain ",x," already in scope"] newValue:= [x,:delete(x,l)] $insideCapsuleFunctionIfTrue => ($CapsuleDomainsInScope:= newValue; e) @@ -475,13 +475,13 @@ chaseInferences(pred,$e) == u is ['%when,:l] => for [ante,:conseq] in l repeat ante=pred => [foo w for w in conseq] - ante is ["and",:ante'] and member(pred,ante') => + ante is ["and",:ante'] and listMember?(pred,ante') => ante':= delete(pred,ante') v':= # ante'=1 => first ante' ["and",:ante'] v':= ['%when,[v',:conseq]] - member(v',get("$Information","special",$e)) => nil + listMember?(v',get("$Information","special",$e)) => nil $e:= put("$Information","special",[v',: get("$Information","special",$e)],$e) @@ -502,7 +502,7 @@ infoToHas a == ++ denotated by `pred' is derivable from the current environment. knownInfo pred == pred=true => true - member(pred,get("$Information","special",$e)) => true + listMember?(pred,get("$Information","special",$e)) => true pred is ["OR",:l] => or/[knownInfo u for u in l] pred is ["AND",:l] => and/[knownInfo u for u in l] pred is ["or",:l] => or/[knownInfo u for u in l] @@ -512,8 +512,8 @@ knownInfo pred == stackAndThrow('"can't find category of %1pb",[name]) [vv,.,.]:= compMakeCategoryObject(second v,$e) or return stackAndThrow('"can't make category of %1pb",[name]) - member(attr,vv.2) => true - x:= assoc(attr,vv.2) => knownInfo second x + listMember?(attr,vv.2) => true + x := assoc(attr,vv.2) => knownInfo second x --format is a list of two elements: information, predicate false pred is ["has",name,cat] => @@ -529,11 +529,11 @@ knownInfo pred == stackAndThrow('"can't find category of %1pb",[name]) vmode := v.mode cat = vmode => true - vmode is ["Join",:l] and member(cat,l) => true + vmode is ["Join",:l] and listMember?(cat,l) => true [vv,.,.]:= compMakeCategoryObject(vmode,$e) or return stackAndThrow('"cannot find category %1pb",[vmode]) catlist := vv.4 - member(cat,first catlist) => true --checks princ. ancestors + listMember?(cat,first catlist) => true --checks princ. ancestors (u:=assoc(cat,second catlist)) and knownInfo second u => true -- previous line checks fundamental anscestors, we should check their -- principal anscestors but this requires instantiating categories @@ -560,7 +560,7 @@ actOnInfo(u,$e) == u is ['%when,:l] => --there is nowhere %else that this sort of thing exists for [ante,:conseq] in l repeat - if member(hasToInfo ante,Info) then for v in conseq repeat + if listMember?(hasToInfo ante,Info) then for v in conseq repeat $e:= actOnInfo(v,$e) $e u is ["ATTRIBUTE",name,att] => @@ -595,7 +595,7 @@ actOnInfo(u,$e) == [ocatvec,.,$e]:= compMakeCategoryObject(vmode,$e) --we are adding a principal descendant of what was already known - member(cat,first ocatvec.4) or + listMember?(cat,first ocatvec.4) or assoc(cat,second ocatvec.4) is [.,"T",.] => $e --what was being asserted is an ancestor of what was known if name="$" diff --git a/src/interp/msg.boot b/src/interp/msg.boot index 1cf335fd..156906a9 100644 --- a/src/interp/msg.boot +++ b/src/interp/msg.boot @@ -302,7 +302,7 @@ redundant(msg,thisPosMsgs) == for item in $noRepList repeat sameMsg?(msg,item) => return (found := true) $noRepList := [msg,$noRepList] - found or member(msg,thisPosMsgs) + found or listMember?(msg,thisPosMsgs) sameMsg? (msg1,msg2) == (getMsgKey msg1 = getMsgKey msg2) and _ |