aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interp/ax.boot4
-rw-r--r--src/interp/c-util.boot25
-rw-r--r--src/interp/clammed.boot4
-rw-r--r--src/interp/compiler.boot20
-rw-r--r--src/interp/database.boot10
-rw-r--r--src/interp/define.boot4
-rw-r--r--src/interp/g-cndata.boot4
-rw-r--r--src/interp/g-opt.boot8
-rw-r--r--src/interp/g-util.boot4
-rw-r--r--src/interp/hashcode.boot6
-rw-r--r--src/interp/ht-util.boot6
-rw-r--r--src/interp/htsetvar.boot4
-rw-r--r--src/interp/i-analy.boot23
-rw-r--r--src/interp/i-coerce.boot6
-rw-r--r--src/interp/i-eval.boot4
-rw-r--r--src/interp/i-map.boot14
-rw-r--r--src/interp/i-object.boot2
-rw-r--r--src/interp/i-output.boot2
-rw-r--r--src/interp/i-special.boot16
-rw-r--r--src/interp/i-syscmd.boot16
-rw-r--r--src/interp/i-util.boot2
-rw-r--r--src/interp/lisplib.boot6
-rw-r--r--src/interp/msg.boot6
-rw-r--r--src/interp/msgdb.boot2
-rw-r--r--src/interp/newfort.boot2
-rw-r--r--src/interp/nrunfast.boot7
-rw-r--r--src/interp/slam.boot2
-rw-r--r--src/interp/sys-constants.boot4
-rw-r--r--src/interp/trace.boot2
29 files changed, 107 insertions, 108 deletions
diff --git a/src/interp/ax.boot b/src/interp/ax.boot
index 5d94dfb7..9a2d774a 100644
--- a/src/interp/ax.boot
+++ b/src/interp/ax.boot
@@ -117,7 +117,7 @@ modemapToAx(modemap) ==
['Lambda, argdecls, 'Category,
['Label, constructor,
addDefaults(constructor, axFormatType categoryInfo)]]]
- constructor in $extendedDomains =>
+ symbolMember?(constructor,$extendedDomains) =>
null args =>
['Extend, ['Define, ['Declare, constructor, resultType],
['Add, ['PretendTo, ['Add, [], []], resultType], []]]]
@@ -368,7 +368,7 @@ get1defaultOp(op,index) ==
dcSig(numvec,index,numOfArgs))
index := index + numOfArgs + 1
slotNumber := numvec.index
- if not([op,signumList] in $opList) then
+ if not listMember?([op,signumList],$opList) then
$opList := [[op,signumList],:$opList]
index + 1
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 5b8ec150..7dfad406 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -171,6 +171,9 @@ wantArgumentsAsTuple: (%List %Form,%Sig) -> %Boolean
wantArgumentsAsTuple(args,sig) ==
isHomoegenousVarargSignature sig and #args ~= #sig
+abstractionOperator? x ==
+ symbol? x and symbolMember?(x,$AbstractionOperator)
+
++ We are about to seal the (Lisp) definition of a function.
++ Augment the body of any function definition in the form `x'
++ with declarations for unused parameters.
@@ -178,7 +181,7 @@ wantArgumentsAsTuple(args,sig) ==
declareUnusedParameters x == (augment x; x) where
augment x ==
atomic? x => nil
- x is [op,parms,body] and op in $AbstractionOperator =>
+ x is [op,parms,body] and abstractionOperator? op =>
augment body
unused := [p for p in parms | not usedSymbol?(p,body)]
null unused => [body]
@@ -587,17 +590,17 @@ diagnoseUnknownType(t,e) ==
stackSemanticError(['"The identifier", :bright t,
'"is not known to name a type"],nil)
[ctor,:args] := t
- ctor = "Mapping" =>
+ ctor is "Mapping" =>
for t' in args repeat diagnoseUnknownType(t',e)
t
- ctor = "Record" =>
+ ctor is "Record" =>
for [[.,n,t'],:fields] in tails args repeat
diagnoseUnknownType(t',e)
for [.,=n,.] in fields repeat
stackSemanticError(['"Field", :bright n,
'"declared more than once."], nil)
t
- ctor = "Union" =>
+ ctor is "Union" =>
if args is [[":",:.],:.] then
for [[.,n,t'],:fields] in tails args repeat
diagnoseUnknownType(t',e)
@@ -607,7 +610,7 @@ diagnoseUnknownType(t,e) ==
else
for t' in args repeat diagnoseUnknownType(t',e)
t
- ctor = "Enumeration" =>
+ ctor is "Enumeration" =>
for t' in args repeat
IDENTP t' => nil
stackSemanticError(['"Enumerators must be symbols."], nil)
@@ -617,8 +620,8 @@ diagnoseUnknownType(t,e) ==
stackSemanticError(['"Symbolic value ", :bright sym,
'"is listed twice"], nil)
t
- ctor = "[||]" => t
- ctor in $BuiltinConstructorNames => t -- ??? check Record and Union fields
+ ctor is "[||]" => t
+ builtinConstructor? ctor => t
-- ??? Ideally `e' should be a local extension of $CategoryFrame
-- ??? so that we don't have to access it here as a global state.
get(ctor,"isFunctor",$CategoryFrame)
@@ -1110,7 +1113,7 @@ middleEndExpand x ==
[op,:args] := x
IDENTP op and (fun := getOpcodeExpander op) =>
middleEndExpand apply(fun,x,nil)
- op in $middleEndMacroList =>
+ symbol? op and symbolMember?(op,$middleEndMacroList) =>
middleEndExpand MACROEXPAND_-1 x
a := middleEndExpand op
b := middleEndExpand args
@@ -1244,7 +1247,7 @@ expandableDefinition?(vars,body) ==
atomic? body => true
[op,:args] := body
- not IDENTP op or op in $NonExpandableOperators => false
+ not IDENTP op or symbolMember?(op,$NonExpandableOperators) => false
and/[atomic? x for x in args]
or semiSimpleRelativeTo?(body,$simpleVMoperators) =>
usesVariablesLinearly?(body,vars')
@@ -1509,7 +1512,7 @@ massageBackendCode x ==
u in '(PROG LAMBDA) =>
newBindings := []
for y in second x repeat
- not (y in $LocalVars) =>
+ not symbolMember?(y,$LocalVars) =>
$LocalVars := [y,:$LocalVars]
newBindings := [y,:newBindings]
res := massageBackendCode CDDR x
@@ -1759,7 +1762,7 @@ lookupDefiningFunction(op,sig,dc) ==
-- FIXME: However, there may be cylic dependencies
-- such as AN ~> IAN ~> EXPR INT ~> AN that prevents
-- us from full evaluation.
- args = nil and ctor in $SystemInlinableConstructorNames =>
+ args = nil and symbolMember?(ctor,$SystemInlinableConstructorNames) =>
compiledLookup(op,sig,dc)
-- 1.2. Don't look into defaulting package
isDefaultPackageName ctor => nil
diff --git a/src/interp/clammed.boot b/src/interp/clammed.boot
index a44bd8de..58a43906 100644
--- a/src/interp/clammed.boot
+++ b/src/interp/clammed.boot
@@ -176,12 +176,12 @@ isLegitimateMode(t,hasPolyMode,polyVarList) ==
t := equiType t
vl := isPolynomialMode t =>
if vl~='all then
- var:= or/[(x in polyVarList => x;nil) for x in vl] => return false
+ var:= or/[(member(x,polyVarList) => x;nil) for x in vl] => return false
listOfDuplicates vl => return false
polyVarList:= union(vl,polyVarList)
hasPolyMode => false
con := first t
- poly? := (con = 'Polynomial or con = 'Expression)
+ poly? := (con is 'Polynomial or con is 'Expression)
isLegitimateMode(underDomainOf t,poly?,polyVarList)
IDENTP(op := first t) and constructor? op =>
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 68eac24f..e165751e 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -233,7 +233,7 @@ applyMapping([op,:argl],m,e,ml) ==
T() == [.,.,e]:= comp(x,m',e) or return "failed"
if argl' is "failed" then return nil
form:=
- atom op and not(op in $formalArgList) and null (u := get(op,"value",e)) =>
+ symbol? op and not symbolMember?(op,$formalArgList) and null (u := get(op,"value",e)) =>
emitLocalCallInsn(op,argl',e)
-- Compiler synthetized operators are inline.
u ~= nil and u.expr is ["XLAM",:.] => ['%call,u.expr,:argl']
@@ -492,7 +492,7 @@ outputComp(x,e) ==
[x,$OutputForm,e]
compForm1(form is [op,:argl],m,e) ==
- op in $coreDiagnosticFunctions =>
+ symbolMember?(op,$coreDiagnosticFunctions) =>
[[op,:[([.,.,e]:=outputComp(x,e)).expr for x in argl]],m,e]
op is ["elt",domain,op'] =>
domain="Lisp" =>
@@ -590,11 +590,11 @@ compFormWithModemap(form,m,e,modemap) ==
[modemap,e]:= substituteIntoFunctorModemap(argl,modemap,e) or return nil
[map:= [.,target,:.],:cexpr]:= modemap
sv := listOfSharpVars map
- if sv then
+ if sv ~= nil then
-- SAY [ "compiling ", op, " in compFormWithModemap,
-- mode= ",map," sharp vars=",sv]
for x in argl for ss in $FormalMapVariableList repeat
- if ss in sv then
+ if symbolMember?(ss,sv) then
[map:= [.,target,:.],:cexpr]:= modemap :=SUBST(x,ss,modemap)
-- SAY ["new map is",map]
not coerceable(target,m,e) => nil
@@ -817,7 +817,7 @@ setqSingle(id,val,m,E) ==
if $profileCompiler = true then
not IDENTP id => nil
key :=
- id in rest $form => "arguments"
+ symbolMember?(id,$form.args) => "arguments"
"locals"
profileRecord(key,id,T.mode)
newProplist :=
@@ -1355,11 +1355,11 @@ $FFIAggregableDataType ==
getFFIDatatype: %Mode -> %Form
getFFIDatatype t ==
x := getBasicFFIType t => x
- t is [m,["PrimitiveArray",t']] and m in $FFITypeModifier and
+ t is [m,["PrimitiveArray",t']] and symbolMember?(m,$FFITypeModifier) and
listMember?(t',$FFIAggregableDataType) =>
m' :=
- m = "ReadOnly" => bootDenotation "readonly"
- m = "WriteOnly" => bootDenotation "writeonly"
+ m is "ReadOnly" => bootDenotation "readonly"
+ m is "WriteOnly" => bootDenotation "writeonly"
bootDenotation "readwrite"
[m',[bootDenotation "buffer",getBasicFFIType t']]
nil
@@ -1415,7 +1415,7 @@ checkExternalEntity(id,type,lang,e) ==
++ Remove possible modifiers in the FFI type expression `t'.
removeModifiers t ==
for (ts := [x,:.]) in tails t repeat
- x is [m,t'] and m in $FFITypeModifier =>
+ x is [m,t'] and symbolMember?(m,$FFITypeModifier) =>
ts.first := t'
t
@@ -2303,7 +2303,7 @@ massageLoop x == main x where
containsNonLocalControl?(x,tags) ==
atomic? x => false
x is ['THROW,tag,x'] =>
- not(tag in tags) or containsNonLocalControl?(x',tags)
+ not symbolMember?(tag,tags) or containsNonLocalControl?(x',tags)
x is ['CATCH,tag,x'] =>
containsNonLocalControl?(x',[tag,:tags])
or/[containsNonLocalControl?(x',tags) for x' in x]
diff --git a/src/interp/database.boot b/src/interp/database.boot
index 0fe67f99..f52e8fcc 100644
--- a/src/interp/database.boot
+++ b/src/interp/database.boot
@@ -164,8 +164,8 @@ getConstructorKind ctor ==
kind := getConstructorKindFromDB ctor =>
kind = "domain" and isDefaultPackageName ctor => "package"
kind
- ctor in $DomainNames => "domain"
- ctor in $CategoryNames => "category"
+ symbolMember?(ctor,$DomainNames) => "domain"
+ symbolMember?(ctor,$CategoryNames) => "category"
nil
--% Functions for manipulating MODEMAP DATABASE
@@ -297,8 +297,8 @@ orderPredTran(oldList,sig,skip) ==
----- (isDomain *1 ..)
for pred in oldList repeat
((pred is [op,pvar,.] and op in '(isDomain ofCategory)
- and pvar=first sig and not (pvar in rest sig)) or
- (not skip and pred is ['isDomain,pvar,.] and pvar="*1")) =>
+ and pvar=first sig and not symbolMember?(pvar,rest sig)) or
+ (not skip and pred is ['isDomain,pvar,.] and pvar is "*1")) =>
oldList := remove(oldList,pred)
lastPreds:=[pred,:lastPreds]
--sayBrightlyNT "lastPreds="
@@ -362,7 +362,7 @@ orderPredTran(oldList,sig,skip) ==
for pred in newList repeat
if pred is ['isDomain,x,y] or x is ['ofCategory,x,y] then
ids:= listOfPatternIds y
- if "and"/[id in fullDependList for id in ids] then
+ if "and"/[symbolMember?(id,fullDependList) for id in ids] then
fullDependList:= insertWOC(x,fullDependList)
fullDependList:= UNIONQ(fullDependList,ids)
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 4ab517d8..e5c8fefa 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -545,7 +545,7 @@ compDefine1(form,m,e) ==
$insideWhereIfTrue and isMacro(form,e) and (m=$EmptyMode or m=$NoValueMode)
=> [lhs,m,putMacro(lhs.op,rhs,e)]
checkParameterNames lhs.args
- null signature.target and not symbolMember?(KAR rhs,$BuiltinConstructorNames) and
+ null signature.target and symbol? KAR rhs and not builtinConstructor? KAR rhs and
(sig:= getSignatureFromMode(lhs,e)) =>
-- here signature of lhs is determined by a previous declaration
compDefine1(['DEF,lhs,[sig.target,:signature.source],specialCases,rhs],m,e)
@@ -867,7 +867,7 @@ typeDependencyPath(m,path,e) ==
atomic? m => nil
[ctor,:args] := m
-- We don't expect implicit parameters in builtin constructors.
- ctor in $BuiltinConstructorNames => nil
+ builtinConstructor? ctor => nil
-- FIXME: assume constructors cannot be parameters
not constructor? ctor => nil
[:typeDependencyPath(m',[i,:path],e) for m' in args for i in 0..]
diff --git a/src/interp/g-cndata.boot b/src/interp/g-cndata.boot
index 357aa2df..ff50bc36 100644
--- a/src/interp/g-cndata.boot
+++ b/src/interp/g-cndata.boot
@@ -245,8 +245,8 @@ condUnabbrev(op,arglist,argtypes,modeIfTrue) ==
++ are consulted. Consequently, this functions is not appropriate
++ for use in the compiler.
isConstructorName op ==
- op in $BuiltinConstructorNames
- or getConstructorAbbreviationFromDB op
+ getConstructorAbbreviationFromDB op
+ or builtinConstructor? op
--% Code Being Phased Out
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 23648b53..356f80d8 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -42,7 +42,7 @@ $optimizableConstructorNames := $SystemInlinableConstructorNames
++ Return true if the domain `dom' is an instance of a functor
++ that has been nominated for inlining.
optimizableDomain? dom ==
- opOf dom in $optimizableConstructorNames
+ symbolMember?(opOf dom,$optimizableConstructorNames)
++ Register the domain `dom' for inlining.
nominateForInlining dom ==
@@ -73,7 +73,7 @@ changeVariableDefinitionToStore(form,vars) ==
atomic? form or form.op is 'CLOSEDFN => vars
form is ['%LET,v,expr] =>
vars := changeVariableDefinitionToStore(expr,vars)
- if v in vars then
+ if symbolMember?(v,vars) then
form.op := '%store
else
vars := [v,:vars]
@@ -94,7 +94,7 @@ changeVariableDefinitionToStore(form,vars) ==
vars' := [v,:vars']
changeVariableDefinitionToStore(third form,vars')
vars
- form.op in $AbstractionOperator =>
+ abstractionOperator? form.op =>
changeVariableDefinitionToStore(third form,[:second form,:vars])
vars
for x in form repeat
@@ -180,7 +180,7 @@ simplifyVMForm x ==
atomic? x => x
x.op is 'CLOSEDFN => x
atom x.op =>
- x is [op,vars,body] and op in $AbstractionOperator =>
+ x is [op,vars,body] and abstractionOperator? op =>
third(x) := simplifyVMForm body
x
if x.op is 'IF then
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 11960741..e1ff661a 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -57,8 +57,8 @@ usedSymbol?(s,x) ==
symbol? x => s = x
atom x => false
x is ['QUOTE,:.] => false
- x is [op,parms,:body] and op in $AbstractionOperator =>
- s in parms => false
+ x is [op,parms,:body] and abstractionOperator? op =>
+ symbolMember?(s,parms) => false
usedSymbol?(s,body)
or/[usedSymbol?(s,x') for x' in x]
diff --git a/src/interp/hashcode.boot b/src/interp/hashcode.boot
index cfae0d52..af6547f6 100644
--- a/src/interp/hashcode.boot
+++ b/src/interp/hashcode.boot
@@ -57,7 +57,7 @@ hashType(type, percentHash) ==
isDomain type => getDomainHash type
[op, :args] := type
hash := hashString symbolName op
- op = 'Mapping =>
+ op is 'Mapping =>
hash := hashString '"->"
[retType, :mapArgs] := args
for arg in mapArgs repeat
@@ -65,11 +65,11 @@ hashType(type, percentHash) ==
retCode := hashType(retType, percentHash)
scalarEq?(retCode, $VoidHash) => hash
hashCombine(retCode, hash)
- op = 'Enumeration =>
+ op is 'Enumeration =>
for arg in args repeat
hash := hashCombine(hashString(symbolName arg), hash)
hash
- op in $DomainsWithoutLisplibs =>
+ symbolMember?(op,$DomainsWithoutLisplibs) =>
for arg in args repeat
hash := hashCombine(hashType(arg, percentHash), hash)
hash
diff --git a/src/interp/ht-util.boot b/src/interp/ht-util.boot
index 76e6bab7..028df423 100644
--- a/src/interp/ht-util.boot
+++ b/src/interp/ht-util.boot
@@ -51,7 +51,7 @@ $activePageList := nil
--%
htpDestroyPage(pageName) ==
- pageName in $activePageList =>
+ symbolMember?(pageName,$activePageList) =>
setDynamicBinding(pageName, nil)
$activePageList := remove!($activePageList,pageName)
@@ -382,14 +382,14 @@ pvarCondList pvar ==
pvarCondList1(pvarList, activeConds, condList) ==
null condList => activeConds
[cond, : restConds] := condList
- cond is [., pv, pattern] and pv in pvarList =>
+ cond is [., pv, pattern] and symbolMember?(pv,pvarList) =>
pvarCondList1(append!(pvarList, pvarsOfPattern pattern),
[cond, :activeConds], restConds)
pvarCondList1(pvarList, activeConds, restConds)
pvarsOfPattern pattern ==
not LISTP pattern => nil
- [pvar for pvar in rest pattern | pvar in $PatternVariableList]
+ [pvar for pvar in rest pattern | symbolMember?(pvar,$PatternVariableList)]
htMakeTemplates(templateList, numLabels) ==
templateList := [templateParts template for template in templateList]
diff --git a/src/interp/htsetvar.boot b/src/interp/htsetvar.boot
index f05c43fc..827df141 100644
--- a/src/interp/htsetvar.boot
+++ b/src/interp/htsetvar.boot
@@ -280,7 +280,7 @@ htCheckList(checker,value) ==
if value in '(n no N NO) then value := 'no
checker is [n,m] and integer? n =>
m = n + 1 =>
- value in checker => value
+ scalarMember(value,checker) => value
n
null m =>
integer? value and value >= n => value
@@ -288,7 +288,7 @@ htCheckList(checker,value) ==
integer? m =>
integer? value and value >= n and value <= m => value
n
- value in checker => value
+ membr(value,checker) => value
first checker
-- emlist := strconc/[strconc('" {\em ",PNAME x,'"} ") for x in checker]
-- strconc('"Please enter one of: ",emlist)
diff --git a/src/interp/i-analy.boot b/src/interp/i-analy.boot
index dae28d1b..e8a4e2ca 100644
--- a/src/interp/i-analy.boot
+++ b/src/interp/i-analy.boot
@@ -77,7 +77,7 @@ getMinimalVariableTower(var,t) ==
u = var => t
getMinimalVariableTower(var,t')
t is [mp,u,t'] and symbolMember?(mp,$multivariateDomains) =>
- var in u => t
+ member(var,u) => t
getMinimalVariableTower(var,t')
null (t' := underDomainOf t) => nil
getMinimalVariableTower(var,t')
@@ -93,7 +93,7 @@ getMinimalVarMode(id,m) ==
defaultMode :=
$Symbol
null m => defaultMode
- (vl := polyVarlist m) and ((id in vl) or 'all in vl) =>
+ (vl := polyVarlist m) and (member(id,vl) or 'all in vl) =>
substitute($Integer,$EmptyMode,m)
(um := underDomainOf m) => getMinimalVarMode(id,um)
defaultMode
@@ -109,13 +109,10 @@ polyVarlist m ==
[., ., a, :.] := m
a := removeQuote a
[a]
- op in '(Polynomial RationalFunction Expression) =>
- '(all)
+ op in '(Polynomial RationalFunction Expression) => '(all)
a := removeQuote a
- op in '(UnivariatePolynomial) =>
- [a]
- op in $multivariateDomains =>
- a
+ op in '(UnivariatePolynomial) => [a]
+ symbolMember?(op,$multivariateDomains) => a
nil
--% Pushing Down Target Information
@@ -339,13 +336,13 @@ bottomUpCompilePredicate(pred, name) ==
isUnambiguouslyConstructor(id,t) ==
niladicConstructorFromDB id => nil
k := getConstructorKindFromDB id or
- id in $DomainNames => "domain"
- id in $CategoryNames => "category"
+ symbolMember?(id,$DomainNames) => "domain"
+ symbolMember?(id,$CategoryNames) => "category"
k = nil => nil
ms :=
k = "category" => [$CategoryConstructor]
[$DomainConstructor]
- if not(id in $BuiltinConstructorNames) then
+ if not builtinConstructor? id then
loadIfNecessary id
putValue(t,objNewWrap(id,first ms))
putModeSet(t,ms)
@@ -457,8 +454,8 @@ bottomUpDefaultEval(t,id,defaultMode,target,isSub) ==
if isPartialMode target then
-- this hackery will go away when Symbol is not the default type
if defaultMode = $Symbol and (target is [D,x,.]) then
- (D in $univariateDomains and (x = id)) or
- (D in $multivariateDomains and (id in x)) =>
+ (symbolMember?(D,$univariateDomains) and (x = id)) or
+ (symbolMember?(D,$multivariateDomains) and member(id,x)) =>
dmode := [D,x,$Integer]
(val' := coerceInteractive(objNewWrap(id,
['Variable,id]),dmode)) =>
diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot
index a6dab0c3..6d4c84fe 100644
--- a/src/interp/i-coerce.boot
+++ b/src/interp/i-coerce.boot
@@ -571,7 +571,7 @@ canCoerceByMap(t1,t2) ==
-- save some time for those we know about
know := '(List Vector Segment Stream UniversalSegment Array
Polynomial UnivariatePolynomial SquareMatrix Matrix)
- top in know => canCoerce(u1,u2)
+ symbolMember?(top,know) => canCoerce(u1,u2)
null selectMms1('map,t2,[['Mapping,u2,u1],t1],
[['Mapping,u2,u1],u1],nil) => nil
@@ -617,8 +617,8 @@ canCoerceCommute(t1,t2) ==
-- THIS IS OUT-MODED AND WILL GO AWAY SOON RSS 2-87
-- t1 is t2 with the two top level constructors commuted
-- looks for the existence of a commuting function
- first(t1) in (l := [$QuotientField, 'Gaussian]) and
- first(t2) in l => true
+ symbolMember?(first(t1),(l := [$QuotientField, 'Gaussian])) and
+ symbolMember?(first(t2),l) => true
p:= ASSQ(first t1,$CommuteTable)
p and ASSQ(first t2,rest p) is [.,:['commute,.]]
diff --git a/src/interp/i-eval.boot b/src/interp/i-eval.boot
index 597566b0..17b9f2f8 100644
--- a/src/interp/i-eval.boot
+++ b/src/interp/i-eval.boot
@@ -109,7 +109,7 @@ evaluateType0 form ==
constructor? op => evaluateType1 form
nil
IDENTP form and niladicConstructorFromDB form => evaluateType [form]
- IDENTP form and (constructor? form or form in $BuiltinConstructorNames) =>
+ IDENTP form and (constructor? form or builtinConstructor? form) =>
throwEvalTypeMsg("S2IE0003",[form,form])
++ Check for duplicate fields in a Union or Record domain form.
@@ -157,7 +157,7 @@ evaluateType form ==
form
evaluateFormAsType form
IDENTP form and niladicConstructorFromDB form => evaluateType [form]
- IDENTP form and (constructor? form or form in $BuiltinConstructorNames) =>
+ IDENTP form and (constructor? form or builtinConstructor? form) =>
throwEvalTypeMsg("S2IE0003",[form,form])
evaluateFormAsType form
diff --git a/src/interp/i-map.boot b/src/interp/i-map.boot
index 0d41f57b..03527f2c 100644
--- a/src/interp/i-map.boot
+++ b/src/interp/i-map.boot
@@ -287,7 +287,7 @@ mkMapAlias(op,argl) ==
mkAliasList l == fn(l,nil) where fn(l,acc) ==
null l => reverse! acc
- not IDENTP first l or first l in acc => fn(rest l,[nil,:acc])
+ not symbol? first l or symbolMember?(first l,acc) => fn(rest l,[nil,:acc])
fn(rest l,[first l,:acc])
args2Tuple args ==
@@ -379,7 +379,7 @@ clearDependencies(x,clearLocalModemapsIfTrue) ==
clearDep1(x,nil,nil,$dependencies)
clearDep1(x,toDoList,doneList,depList) ==
- x in doneList => nil
+ symbolMember?(x,doneList) => nil
clearCache x
newDone:= [x,:doneList]
until null a repeat
@@ -791,7 +791,7 @@ mapRecurDepth(opName,opList,body) ==
atom argl => 0
argl => "MAX"/[mapRecurDepth(opName,opList,x) for x in argl]
0
- op in opList => argc
+ symbolMember?(op,opList) => argc
op=opName => 1 + argc
(obj := get(op,'value,$e)) and objVal obj is ["%Map",:mapDef] =>
mapRecurDepth(opName,[op,:opList],getMapBody(op,mapDef))
@@ -853,7 +853,7 @@ analyzeRecursiveMap(op,argTypes,body,parms,n) ==
tar
saveDependentMapInfo(op,opList) ==
- not (op in opList) =>
+ not symbolMember?(op,opList) =>
lmml := [[op, :get(op, 'localModemap, $e)]]
gcl := [[op, :get(op, 'generatedCode, $e)]]
for [dep1,dep2] in getFlag("$dependencies") | dep1=op repeat
@@ -864,7 +864,7 @@ saveDependentMapInfo(op,opList) ==
nil
restoreDependentMapInfo(op, opList, [lmml,:gcl]) ==
- not (op in opList) =>
+ not symbolMember?(op,opList) =>
clearDependentMaps(op,opList)
for [op, :lmm] in lmml repeat
$e := putHist(op,'localModemap,lmm,$e)
@@ -873,7 +873,7 @@ restoreDependentMapInfo(op, opList, [lmml,:gcl]) ==
clearDependentMaps(op,opList) ==
-- clears the local modemaps of all the maps that depend on op
- not (op in opList) =>
+ not symbolMember?(op,opList) =>
$e := putHist(op,'localModemap,nil,$e)
$e := putHist(op,'generatedCode,nil,$e)
for [dep1,dep2] in getFlag("$dependencies") | dep1=op repeat
@@ -900,7 +900,7 @@ expandRecursiveBody(alreadyExpanded, body) ==
((numMapArgs mapDef) = 0) => getMapBody(body,mapDef)
body
body is [op,:argl] =>
- not (op in alreadyExpanded) =>
+ not symbolMember?(op,alreadyExpanded) =>
(obj := get(op,'value,$e)) and objVal obj is ["%Map",:mapDef] =>
newBody:= getMapBody(op,mapDef)
for arg in argl for var in $FormalMapVariableList repeat
diff --git a/src/interp/i-object.boot b/src/interp/i-object.boot
index 5e4db99f..fed81896 100644
--- a/src/interp/i-object.boot
+++ b/src/interp/i-object.boot
@@ -464,7 +464,7 @@ transferPropsToNode(x,t) ==
where
transfer(x,node,prop) ==
u := get(x,prop,$env) => putAtree(node,prop,u)
- (not (x in $localVars)) and (u := get(x,prop,$e)) =>
+ (not member(x,$localVars)) and (u := get(x,prop,$e)) =>
putAtree(node,prop,u)
if not getMode(t) and (am := get(x,'automode,$env)) then
putModeSet(t,[am])
diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot
index 113aeed7..2c3ec427 100644
--- a/src/interp/i-output.boot
+++ b/src/interp/i-output.boot
@@ -2628,7 +2628,7 @@ callForm2String x ==
atom x => primaryForm2String x
[op,:args] := x
- op in $allClassicOps => primaryForm2String x
+ member(op,$allClassicOps) => primaryForm2String x
#args = 0 =>
op = "Zero" => '"0"
diff --git a/src/interp/i-special.boot b/src/interp/i-special.boot
index 88c0cb31..bc0b63b4 100644
--- a/src/interp/i-special.boot
+++ b/src/interp/i-special.boot
@@ -975,7 +975,7 @@ upconstruct t ==
isTaggedUnion tar => upTaggedUnionConstruct(op,l,tar)
aggs := '(List)
if tar and cons?(tar) and not isPartialMode(tar) then
- first(tar) in aggs =>
+ symbolMember?(first(tar),aggs) =>
ud :=
(l is [[realOp, :.]]) and (getUnname(realOp) = 'COLLECT) => tar
second tar
@@ -986,11 +986,11 @@ upconstruct t ==
nargs := #l
argModeSetList:= [bottomUp putCallInfo(x,"construct",i,nargs)
for x in l for i in 1..]
- dol and dol is [topType,:.] and not (topType in aggs) =>
+ dol and dol is [topType,:.] and not symbolMember?(topType,aggs) =>
(mmS:= selectMms(op,l,tar)) and (mS:= evalForm(op,getUnname op,l,mmS)) =>
putModeSet(op,mS)
nil
- (tar and tar is [topType,:.] and not (topType in aggs)) and
+ (tar and tar is [topType,:.] and not symbolMember?(topType,aggs)) and
(mmS:= modemapsHavingTarget(selectMms(op,l,tar),tar)) and
(mS:= evalForm(op,getUnname op,l,mmS)) =>
putModeSet(op,mS)
@@ -1252,19 +1252,19 @@ isPolynomialMode m ==
containsPolynomial m ==
atom m => nil
[d,:.] := m
- d in $univariateDomains or d in $multivariateDomains or
+ symbolMember?(d,$univariateDomains) or symbolMember?(d,$multivariateDomains) or
d in '(Polynomial RationalFunction) => true
(m' := underDomainOf m) and containsPolynomial m'
containsVariables m ==
atom m => nil
[d,:.] := m
- d in $univariateDomains or d in $multivariateDomains => true
+ symbolMember?(d,$univariateDomains) or symbolMember?(d,$multivariateDomains) => true
(m' := underDomainOf m) and containsVariables m'
listOfDuplicates l ==
l is [x,:l'] =>
- x in l' => [x,:listOfDuplicates deleteAll(x,l')]
+ member(x,l') => [x,:listOfDuplicates deleteAll(x,l')]
listOfDuplicates l'
-- The following function removes all occurrences of x from the list l
@@ -2036,7 +2036,7 @@ getInterpMacroNames() ==
isInterpMacro name ==
-- look in local and then global environment for a macro
not IDENTP name => nil
- name in $specialOps => nil
+ symbolMember?(name,$specialOps) => nil
(m := get("--macros--",name,$env)) => m
(m := get("--macros--",name,$e)) => m
(m := get("--macros--",name,$InteractiveFrame)) => m
@@ -2342,7 +2342,7 @@ uptuple t ==
isTaggedUnion tar => upTaggedUnionConstruct(op,l,tar)
aggs := '(List)
if tar and cons?(tar) and not isPartialMode(tar) then
- first(tar) in aggs =>
+ symbolMember?(first(tar),aggs) =>
ud := second tar
for x in l repeat if not getTarget(x) then putTarget(x,ud)
first(tar) in '(Matrix SquareMatrix RectangularMatrix) =>
diff --git a/src/interp/i-syscmd.boot b/src/interp/i-syscmd.boot
index 6bd05c9c..e25e6290 100644
--- a/src/interp/i-syscmd.boot
+++ b/src/interp/i-syscmd.boot
@@ -355,8 +355,8 @@ clearCmdParts(l is [opt,:vl]) ==
$e : local := $InteractiveFrame
for x in vl repeat
clearDependencies(x,true)
- if option='properties and x in pmacs then clearParserMacro(x)
- if option='properties and x in imacs and not (x in pmacs) then
+ if option='properties and symbolMember?(x,pmacs) then clearParserMacro(x)
+ if option='properties and symbolMember?(x,imacs) and not symbolMember?(x,pmacs) then
sayMessage ['" You cannot clear the definition of the system-defined macro ",
fixObjectForPrinting x,"."]
p1 := assoc(x,CAAR $InteractiveFrame) =>
@@ -1017,25 +1017,25 @@ displayMacros names ==
first := true
for macro in macros repeat
- macro in pmacs =>
+ symbolMember?(macro,pmacs) =>
if first then
sayBrightly ['"%l",'"User-defined macros:"]
first := nil
displayParserMacro macro
- macro in imacs => 'iterate
+ symbolMember?(macro,imacs) => 'iterate
sayBrightly ([" ",'"%b", macro, '"%d", " is not a known OpenAxiom macro."])
-- now system ones
first := true
for macro in macros repeat
- macro in imacs =>
+ symbolMember?(macro,imacs) =>
macro in pmacs => 'iterate
if first then
sayBrightly ['"%l",'"System-defined macros:"]
first := nil
displayMacro macro
- macro in pmacs => 'iterate
+ symbolMember?(macro,pmacs) => 'iterate
nil
getParserMacroNames() ==
@@ -1131,7 +1131,7 @@ displayProperties(option,l) ==
v1 := fixObjectForPrinting(v)
sayMSG ['"Properties of",:bright prefix2String v1,'":"]
null pl =>
- v in pmacs =>
+ symbolMember?(v,pmacs) =>
sayMSG '" This is a user-defined macro."
displayParserMacro v
isInterpMacro v =>
@@ -2420,7 +2420,7 @@ reportOpsFromLisplib1(unitForm,u) ==
editFile showFile
reportOpsFromUnitDirectly unitForm ==
- isRecordOrUnion := unitForm is [a,:.] and a in $DomainNames
+ isRecordOrUnion := unitForm is [a,:.] and symbolMember?(a,$DomainNames)
unit:= evalDomain unitForm
top:= first unitForm
kind:= getConstructorKindFromDB top
diff --git a/src/interp/i-util.boot b/src/interp/i-util.boot
index 367eeff1..a7266f89 100644
--- a/src/interp/i-util.boot
+++ b/src/interp/i-util.boot
@@ -176,4 +176,4 @@ extractCONDClauses clauses ==
++ Returns true if symbol `id' is either a local variable
++ or an iterator variable.
isLocallyBound id ==
- id in $localVars or id in $iteratorVars
+ symbolMember?(id,$localVars) or symbolMember?(id,$iteratorVars)
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index afc696d6..476d7548 100644
--- a/src/interp/lisplib.boot
+++ b/src/interp/lisplib.boot
@@ -279,7 +279,7 @@ killNestedInstantiations(deps) ==
isNestedInstantiation(form,deps) ==
form is [op,:argl] =>
- op in deps => true
+ symbolMember?(op,deps) => true
or/[isNestedInstantiation(x,deps) for x in argl]
false
@@ -404,7 +404,7 @@ loadFunctor u ==
makeConstructorsAutoLoad() ==
for cnam in allConstructors() repeat
- cnam in $CategoryNames => nil
+ symbolMember?(cnam,$CategoryNames) => nil
property(cnam,'LOADED) := nil
-- fn:=getConstructorAbbreviationFromDB cnam
if niladicConstructorFromDB cnam
@@ -427,7 +427,7 @@ systemDependentMkAutoload(fn,cnam) ==
autoLoad(abb,cname) ==
-- builtin constructors are always loaded. By definition, there
-- is no way to unload them and load them again.
- cname in $BuiltinConstructorNames => cname
+ builtinConstructor? cname => cname
if not property(cname,'LOADED) then loadLib cname
symbolFunction cname
diff --git a/src/interp/msg.boot b/src/interp/msg.boot
index 4e4c8542..fcffa99e 100644
--- a/src/interp/msg.boot
+++ b/src/interp/msg.boot
@@ -59,9 +59,6 @@ $ncMsgList := []
--%
-ListMember?(ob, l) ==
- MEMBER(ob, l, KEYWORD::TEST, function EQUAL)
-
--% Messages for the USERS of the compiler.
-- The program being compiled has a minor error.
-- Give a message and continue processing.
@@ -493,7 +490,8 @@ setMsgCatlessAttr(msg,attr) ==
whichCat attr ==
found := 'catless
for cat in $attrCats repeat
- if ListMember? (attr,eval cat) then
+ -- ??? a cat is a vector.
+ if listMember?(attr,eval cat) then
found := cat
return found
found
diff --git a/src/interp/msgdb.boot b/src/interp/msgdb.boot
index c2aae240..6623cb5b 100644
--- a/src/interp/msgdb.boot
+++ b/src/interp/msgdb.boot
@@ -445,7 +445,7 @@ flowSegmentedMsg(msg, len, offset) ==
-- that nothing needs to be done
$texFormatting => msg
-- msgs that are entirely centered are not flowed
- msg is [[ce,:.]] and ListMember?(ce,'(%ce "%ce")) => msg
+ msg is [[ce,:.]] and listMember?(ce,'(%ce "%ce")) => msg
potentialMarg := 0
actualMarg := 0
diff --git a/src/interp/newfort.boot b/src/interp/newfort.boot
index 47e9ac1d..43ad03c0 100644
--- a/src/interp/newfort.boot
+++ b/src/interp/newfort.boot
@@ -812,7 +812,7 @@ fortPre1 e ==
specialOps := '(BRACKET BRACE SUB AGGLST SUPERSUB MATRIX SEGMENT ALTSUPERSUB
PAREN CONCAT CONCATB QUOTE STRING SIGMA STEP IN SIGMA2
INTSIGN PI PI2 INDEFINTEGRAL)
- op in specialOps => exp2FortSpecial(op,args,#args)
+ symbolMember?(op,specialOps) => exp2FortSpecial(op,args,#args)
member(op,['"*", "*", '"+", "+", '"-", "-"]) and (#args > 2) =>
binaryExpr := fortPre1 [op,first args, second args]
for i in 3..#args repeat
diff --git a/src/interp/nrunfast.boot b/src/interp/nrunfast.boot
index e5dff431..6691b34d 100644
--- a/src/interp/nrunfast.boot
+++ b/src/interp/nrunfast.boot
@@ -37,6 +37,7 @@ namespace BOOT
module nrunfast where
getOpCode: (%Symbol, %Vector %Thing, %Short) -> %Maybe %Short
+ builtinConstructor?: %Symbol -> %Boolean
++
$doNotCompressHashTableIfTrue := false
@@ -493,9 +494,13 @@ lazyMatchArg2(s,a,dollar,domain,typeFlag) ==
--above line is temporarily necessary until system is compiled 8/15/90
--s = a
+++ The collection of builtin category names and builtin domain names.
+$BuiltinConstructorNames ==
+ [:$CategoryNames,:$DomainNames]
+
++ Return true if the symbol `s' designates a builtin constructor.
builtinConstructor? s ==
- s in $BuiltinConstructorNames
+ symbolMember?(s,$BuiltinConstructorNames)
++ Return true if the symbol `s' designates a generalized builtin
++ constructor, that is a builtin constructor or any operator we
diff --git a/src/interp/slam.boot b/src/interp/slam.boot
index c62a03d1..8afcb904 100644
--- a/src/interp/slam.boot
+++ b/src/interp/slam.boot
@@ -423,7 +423,7 @@ clearLocalModemaps x ==
compileInteractive fn ==
if $InteractiveMode then startTimingProcess 'compilation
- if fn is [.,[bindOp,.,.]] and bindOp in $AbstractionOperator then
+ if fn is [.,[bindOp,.,.]] and abstractionOperator? bindOp then
fn := [first fn,declareUnusedParameters second fn]
if $reportCompilation then
sayBrightlyI bright '"Generated LISP code for function:"
diff --git a/src/interp/sys-constants.boot b/src/interp/sys-constants.boot
index c5d8656b..331208ce 100644
--- a/src/interp/sys-constants.boot
+++ b/src/interp/sys-constants.boot
@@ -561,10 +561,6 @@ $DomainNames ==
Record _
Enumeration)
-++ The union of the above two lists.
-$BuiltinConstructorNames ==
- [:$CategoryNames,:$DomainNames]
-
++ List of language support type forms.
$LangSupportTypes ==
'((Mode) (Domain) (Type) (Category))
diff --git a/src/interp/trace.boot b/src/interp/trace.boot
index 8228a432..dc1874f1 100644
--- a/src/interp/trace.boot
+++ b/src/interp/trace.boot
@@ -301,7 +301,7 @@ transTraceItem x ==
$doNotAddEmptyModeIfTrue: local:=true
atom x =>
(value:=get(x,"value",$InteractiveFrame)) and
- (objMode value in $LangSupportTypes) =>
+ member(objMode value,$LangSupportTypes) =>
x := objVal value
(y:= domainToGenvar x) => y
x