From 64dee33447f6db28cfe4d6abe92e51bf4e70a2c6 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 6 May 2008 15:37:58 +0000 Subject: * interp/define.boot: Explicitly initialize fluid variables. * interp/functor.boot: Likewise. * interp/g-opt.boot: Likewise. * interp/nruncomp.boot: Likewise. * interp/nrunfast.boot: Likewise. * interp/package.boot: Likewise. * interp/parse.boot: Likewise. * interp/pspad1.boot: Likewise. * interp/record.boot: Likewise. * interp/template.boot: Likewise. * interp/trace.boot: Likewise. * interp/wi1.boot: Likewise. * interp/wi2.boot: Likewise. --- src/interp/define.boot | 68 ++++++++++++++++++++++++------------------------ src/interp/functor.boot | 9 +++---- src/interp/g-opt.boot | 2 +- src/interp/nruncomp.boot | 26 +++++++++--------- src/interp/nrunfast.boot | 2 +- src/interp/package.boot | 6 ++--- src/interp/parse.boot | 2 +- src/interp/pspad1.boot | 2 +- src/interp/record.boot | 2 +- src/interp/template.boot | 4 +-- src/interp/trace.boot | 6 ++--- src/interp/wi1.boot | 10 +++---- src/interp/wi2.boot | 30 ++++++++++----------- 13 files changed, 84 insertions(+), 85 deletions(-) (limited to 'src/interp') diff --git a/src/interp/define.boot b/src/interp/define.boot index 661fdf5b..6d04bfcf 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -58,8 +58,8 @@ $NRTopt := false compDefine: (%Form,%Mode,%Env) -> %Maybe %Triple compDefine(form,m,e) == $tripleHits: local:= 0 - $macroIfTrue: local - $packagesUsed: local + $macroIfTrue: local := false + $packagesUsed: local := false result:= compDefine1(form,m,e) result @@ -282,9 +282,9 @@ compDefineCategory2(form,signature,specialCases,body,m,e, $TOP__LEVEL: local $definition: local --used by DomainSubstitutionFunction - $form: local - $op: local - $extraParms: local + $form: local := nil + $op: local := nil + $extraParms: local := nil --Set in DomainSubstitutionFunction, used further down -- 1.1 augment e to add declaration $:
[$op,:argl]:= $definition:= form @@ -370,7 +370,7 @@ mkConstructor form == compDefineCategory(df,m,e,prefix,fal) == $domainShell: local -- holds the category of the object being compiled - $lisplibCategory: local + $lisplibCategory: local := nil not $insideFunctorIfTrue and $LISPLIB => compDefineLisplib(df,m,e,prefix,fal,'compDefineCategory1) compDefineCategory1(df,m,e,prefix,fal) @@ -398,7 +398,7 @@ compDefineFunctor1(df is ['DEF,form,signature,$functorSpecialCases,body], if NRTPARSE = true then [lineNumber,:$functorSpecialCases] := $functorSpecialCases -- 1. bind global variables - $addForm: local + $addForm: local := nil $viewNames: local:= nil --This list is only used in genDomainViewName, for generating names @@ -407,24 +407,24 @@ compDefineFunctor1(df is ['DEF,form,signature,$functorSpecialCases,body], --sublist is alist: category . name of view $functionStats: local:= [0,0] $functorStats: local:= [0,0] - $form: local - $op: local - $signature: local - $functorTarget: local - $Representation: local + $form: local := nil + $op: local := nil + $signature: local := nil + $functorTarget: local := nil + $Representation: local := nil --Set in doIt, accessed in the compiler - compNoStacking - $LocalDomainAlist: local --set in doIt, accessed in genDeltaEntry + $LocalDomainAlist: local := [] --set in doIt, accessed in genDeltaEntry $LocalDomainAlist:= nil - $functorForm: local - $functorLocalParameters: local + $functorForm: local := nil + $functorLocalParameters: local := nil SETQ($myFunctorBody, body) - $CheckVectorList: local + $CheckVectorList: local := nil --prevents CheckVector from printing out same message twice $getDomainCode: local -- code for getting views $insideFunctorIfTrue: local:= true - $functorsUsed: local --not currently used, finds dependent functors + $functorsUsed: local := nil --not currently used, finds dependent functors $setelt: local := "setShellEntry" - $TOP__LEVEL: local + $TOP__LEVEL: local := nil $genSDVar: local:= 0 originale:= $e [$op,:argl]:= form @@ -460,7 +460,7 @@ compDefineFunctor1(df is ['DEF,form,signature,$functorSpecialCases,body], REMDUP [CADR x for x in attributeList] -->>-- next global initialized here, used by NRTgenAttributeAlist (NRUNOPT) $NRTattributeAlist: local := NRTgenInitialAttributeAlist attributeList - $NRTslot1Info: local --set in NRTmakeSlot1 called by NRTbuildFunctor + $NRTslot1Info: local := nil --set in NRTmakeSlot1 called by NRTbuildFunctor --this is used below to set $lisplibSlot1 global $NRTaddForm: local := nil -- see compAdd; NRTmakeSlot1 $NRTdeltaList: local := nil --list of misc. elts used in compiled fncts @@ -635,7 +635,7 @@ displayMissingFunctions() == makeFunctorArgumentParameters(argl,sigl,target) == $alternateViewList: local:= nil $forceAdd: local:= true - $ConditionalOperators: local + $ConditionalOperators: local := nil ("append"/[fn(a,augmentSig(s,findExtras(a,target))) for a in argl for s in sigl]) where findExtras(a,target) == @@ -738,8 +738,8 @@ compDefWhereClause(['DEF,form,signature,specialCases,body],m,e) == -- removes declarative and assignment information from form and -- signature, placing it in list L, replacing form by ("where",form',:L), -- signature by a list of NILs (signifying declarations are in e) - $sigAlist: local - $predAlist: local + $sigAlist: local := nil + $predAlist: local := nil -- 1. create sigList= list of all signatures which have embedded -- declarations moved into global variable $sigAlist @@ -812,11 +812,11 @@ compDefineCapsuleFunction(df is ['DEF,form,signature,specialCases,body], [lineNumber,:specialCases] := specialCases e := oldE --1. bind global variables - $form: local - $op: local + $form: local := nil + $op: local := nil $functionStats: local:= [0,0] - $argumentConditionList: local - $finalEnv: local + $argumentConditionList: local := nil + $finalEnv: local := nil --used by ReplaceExitEtc to get a common environment $initCapsuleErrorCount: local:= #$semanticErrorStack $insideCapsuleFunctionIfTrue: local:= true @@ -1056,7 +1056,7 @@ canCacheLocalDomain(dom,elt)== compileCases(x,$e) == -- $e is referenced in compile - $specialCaseKeyList: local + $specialCaseKeyList: local := nil not ($insideFunctorIfTrue=true) => compile x specialCaseAssoc:= [y for y in getSpecialCaseAssoc() | not get(first y,"specialCase",$e) and @@ -1176,7 +1176,7 @@ compileConstructor1 (form:=[fn,[key,vl,:bodyl]]) == -- fn is the name of some category/domain/package constructor; -- we will cache all of its values on $ConstructorCache with reference -- counts - $clamList: local + $clamList: local := nil lambdaOrSlam := getConstructorKindFromDB fn = "category" => 'SPADSLAM $mutableDomain => 'LAMBDA @@ -1263,7 +1263,7 @@ compCapsule(['CAPSULE,:itemList],m,e) == compSubDomain: (%Form,%Mode,%Env) -> %Maybe %Triple compSubDomain(["SubDomain",domainForm,predicate],m,e) == $addFormLhs: local:= domainForm - $addForm: local + $addForm: local := nil $NRTaddForm := domainForm [$addForm,.,e]:= compSubDomain1(domainForm,predicate,m,e) --+ @@ -1307,9 +1307,9 @@ processFunctor(form,signature,data,localParList,e) == buildFunctor(form,signature,data,localParList,e) compCapsuleItems(itemlist,$predl,$e) == - $TOP__LEVEL: local - $myFunctorBody :local ---needed for translator - $signatureOfForm: local + $TOP__LEVEL: local := nil + $myFunctorBody :local := nil ---needed for translator + $signatureOfForm: local := nil $suffix: local:= 0 for item in itemlist repeat $e:= compSingleCapsuleItem(item,$predl,$e) $e @@ -1493,8 +1493,8 @@ compCategory(x,m,e) == $TOP__LEVEL: local:= true (m:= resolve(m,$Category))=$Category and x is ['CATEGORY, domainOrPackage,:l] => - $sigList: local - $atList: local + $sigList: local := nil + $atList: local := nil $sigList:= $atList:= nil for x in l repeat compCategoryItem(x,nil) rep:= mkExplicitCategoryFunction(domainOrPackage,$sigList,$atList) diff --git a/src/interp/functor.boot b/src/interp/functor.boot index 5046c462..5026bc2e 100644 --- a/src/interp/functor.boot +++ b/src/interp/functor.boot @@ -50,10 +50,9 @@ keyItem a == DomainPrint(D,brief) == -- If brief is non-NIL, %then only a summary is printed - $WhereList: local - $Sublis: local - $WhereCounter: local - $WhereCounter:= 1 + $WhereList: local := nil + $Sublis: local := nil + $WhereCounter: local := 1 env:= not BOUNDP '$e => $EmptyEnvironment $e='$e => $EmptyEnvironment @@ -780,7 +779,7 @@ InvestigateConditions catvecListMaker == -- discover under what conditions the secondary view are -- always present. $Conditions: local:= nil - $principal: local + $principal: local := nil [$principal,:secondaries]:= catvecListMaker --We are not interested in the principal view --The next block allows for the possibility that $principal may diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index e497c187..4e2b4484 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -254,7 +254,7 @@ AssocBarGensym(key,l) == EqualBarGensym(key,CAR x) => return x EqualBarGensym(x,y) == - $GensymAssoc: fluid + $GensymAssoc: fluid := nil fn(x,y) where fn(x,y) == x=y => true diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot index 6e03833b..7c5015b7 100644 --- a/src/interp/nruncomp.boot +++ b/src/interp/nruncomp.boot @@ -349,25 +349,25 @@ buildFunctor($definition is [name,:args],sig,code,$locals,$e) == --LOCAL BOUND FLUID VARIABLES: $GENNO: local:= 0 --bound in compDefineFunctor1, then as parameter here - $catvecList: local --list of vectors v1..vn for each view - $hasCategoryAlist: local --list of GENSYMs bound to (HasCategory ..) items - $catNames: local --list of names n1..nn for each view - $maximalViews: local --list of maximal categories for domain (???) - $catsig: local --target category (used in ProcessCond) - $SetFunctions: local --copy of p view with preds telling when fnct defined - $MissingFunctionInfo: local --now useless + $catvecList: local := nil --list of vectors v1..vn for each view + $hasCategoryAlist: local := nil --list of GENSYMs bound to (HasCategory ..) items + $catNames: local := nil --list of names n1..nn for each view + $maximalViews: local := nil --list of maximal categories for domain (???) + $catsig: local := nil --target category (used in ProcessCond) + $SetFunctions: local := nil --copy of p view with preds telling when fnct defined + $MissingFunctionInfo: local := nil --now useless --vector marking which functions are assigned - $ConstantAssignments: local --code for creation of constants + $ConstantAssignments: local := nil --code for creation of constants $epilogue: local := nil --code to set slot 5, things to be done last - $HackSlot4: local --Invention of JHD 13/July/86-set in InvestigateConditions - $extraParms:local --Set in DomainSubstitutionFunction, used in setVector12 - $devaluateList: local --Bound to ((#1 . dv$1)..) where &1 := devaluate #1 later + $HackSlot4: local := nil --Invention of JHD 13/July/86-set in InvestigateConditions + $extraParms:local := nil --Set in DomainSubstitutionFunction, used in setVector12 + $devaluateList: local := nil --Bound to ((#1 . dv$1)..) where &1 := devaluate #1 later $devaluateList:= [[arg,:b] for arg in args for b in $ModeVariableList] - $supplementaries: local + $supplementaries: local := nil --set in InvestigateConditions to represent any additional --category membership tests that may be needed(see buildFunctor for details) ------------------------ - $maximalViews: local + $maximalViews: local := nil oldtime:= TEMPUS_-FUGIT() [$catsig,:argsig]:= sig catvecListMaker:=REMDUP diff --git a/src/interp/nrunfast.boot b/src/interp/nrunfast.boot index 2fbc1c88..0bee8ef9 100644 --- a/src/interp/nrunfast.boot +++ b/src/interp/nrunfast.boot @@ -530,7 +530,7 @@ newExpandLocalTypeArgs(u,dollar,domain,typeFlag) == newExpandLocalTypeForm(u,dollar,domain) nrtEval(expr,dom) == - $:fluid := dom + $:fluid := dom --??? this should be a substitute eval expr domainVal(dollar,domain,index) == diff --git a/src/interp/package.boot b/src/interp/package.boot index e6788af1..ae98ea1c 100644 --- a/src/interp/package.boot +++ b/src/interp/package.boot @@ -46,11 +46,11 @@ processFunctorOrPackage(form,signature,data,localParList,m,e) == processPackage($definition is [name,:args],[$catsig,:argssig],code,locals,$e) == $GENNO: local:= 0 --for GENVAR() - $catsig: local + $catsig: local := nil --used in ProcessCond - $maximalViews: local + $maximalViews: local := nil --read by ProcessCond - $ResetItems: local + $ResetItems: local := nil --stores those items that get SETQed, and may need re-processing $catvecList: local:= [$domainShell] $catNames: local:= ["$"] diff --git a/src/interp/parse.boot b/src/interp/parse.boot index 0a157057..0ba361ba 100644 --- a/src/interp/parse.boot +++ b/src/interp/parse.boot @@ -48,7 +48,7 @@ parseTransform x == parseTran: %ParseForm -> %Form parseTran x == - $op: local + $op: local := nil atom x => parseAtom x [$op,:argl]:= x u := g($op) where g op == (op is ["elt",op,x] => g x; op) diff --git a/src/interp/pspad1.boot b/src/interp/pspad1.boot index 8201b734..5eb6df45 100644 --- a/src/interp/pspad1.boot +++ b/src/interp/pspad1.boot @@ -82,7 +82,7 @@ lisp2Boot x == $fieldNames := nil $pilesAreOkHere: local:= true $commentsToPrint: local:= nil - $lineBuffer: local + $lineBuffer: local := nil $braceStack: local := nil $marginStack: local:= [0] --$autoLine is true except when inside a try---if true, lines are allowed to break diff --git a/src/interp/record.boot b/src/interp/record.boot index 8d9af571..c7c13e5c 100644 --- a/src/interp/record.boot +++ b/src/interp/record.boot @@ -170,7 +170,7 @@ testInput2Output(lines,n) == $mkTestOutputType: local := nil $mkTestFlag: local := nil $runTestFlag: local := true - $testOutput: local + $testOutput: local := nil evaluateLines lines null n => nil --return from reading trailing system commands typ := $mkTestOutputType diff --git a/src/interp/template.boot b/src/interp/template.boot index 77215762..7cf7a7a3 100644 --- a/src/interp/template.boot +++ b/src/interp/template.boot @@ -69,7 +69,7 @@ markUnique x == --======================================================================= stuffSlots(dollar,template) == - _$: fluid := dollar + _$: fluid := dollar --??? substitute dollarTail := [dollar] for i in 5..MAXINDEX template | item := template.i repeat dollar.i := @@ -92,7 +92,7 @@ stuffSlots(dollar,template) == --------------------> NEW DEFINITION (see interop.boot.pamphlet) evalSlotDomain(u,dollar) == $returnNowhereFromGoGet: local := false - $ : fluid := dollar + $ : fluid := dollar -- ??? substitute $lookupDefaults : local := nil -- new world u = '$ => dollar u = "$$" => dollar diff --git a/src/interp/trace.boot b/src/interp/trace.boot index 8de15dfc..50acb76b 100644 --- a/src/interp/trace.boot +++ b/src/interp/trace.boot @@ -152,7 +152,7 @@ trace1 l == saveMapSig [funName for funName in argument] getTraceOptions options == - $traceErrorStack: local + $traceErrorStack: local := nil optionList:= [getTraceOption x for x in options] $traceErrorStack => null rest $traceErrorStack => @@ -600,7 +600,7 @@ letPrint(x,val,currentFunction) == -- This is the version for use when we have already -- converted the data into type "Expression" letPrint2(x,printform,currentFunction) == - $BreakMode:local + $BreakMode:local := nil if $letAssoc and ((y:= LASSOC(currentFunction,$letAssoc)) or (y:= LASSOC("all",$letAssoc))) then if (y="all" or MEMQ(x,y)) and @@ -620,7 +620,7 @@ letPrint2(x,printform,currentFunction) == -- to convert the data into type "Expression" letPrint3(x,xval,printfn,currentFunction) == - $BreakMode:local + $BreakMode:local := nil if $letAssoc and ((y:= LASSOC(currentFunction,$letAssoc)) or (y:= LASSOC("all",$letAssoc))) then if (y="all" or MEMQ(x,y)) and diff --git a/src/interp/wi1.boot b/src/interp/wi1.boot index db0ae6cd..a0602500 100644 --- a/src/interp/wi1.boot +++ b/src/interp/wi1.boot @@ -1174,12 +1174,12 @@ compDefineCategory2(form,signature,specialCases,body,m,e, $prefix,$formalArgList) == --1. bind global variables $insideCategoryIfTrue: local:= true - $TOP__LEVEL: local - $definition: local + $TOP__LEVEL: local := nil + $definition: local := nil --used by DomainSubstitutionFunction - $form: local - $op: local - $extraParms: local + $form: local := nil + $op: local := nil + $extraParms: local := nil --Set in DomainSubstitutionFunction, used further down -- 1.1 augment e to add declaration $: [$op,:argl]:= $definition:= form diff --git a/src/interp/wi2.boot b/src/interp/wi2.boot index 3641b7af..ecad0fb5 100644 --- a/src/interp/wi2.boot +++ b/src/interp/wi2.boot @@ -42,7 +42,7 @@ compDefineFunctor1(df, m,$e,$prefix,$formalArgList) == if NRTPARSE = true then [lineNumber,:$functorSpecialCases] := $functorSpecialCases -- 1. bind global variables - $addForm: local + $addForm: local := nil $viewNames: local:= nil --This list is only used in genDomainViewName, for generating names @@ -64,23 +64,23 @@ compDefineFunctor1(df, m,$e,$prefix,$formalArgList) == $domainLevelVariableList: local := nil--for conversion to new compiler 3/93 $localLoopVariables: local := nil $pathStack : local := nil - $form: local - $op: local - $signature: local - $functorTarget: local - $Representation: local + $form: local := nil + $op: local := nil + $signature: local := nil + $functorTarget: local := nil + $Representation: local := nil --Set in doIt, accessed in the compiler - compNoStacking $LocalDomainAlist: local --set in doIt, accessed in genDeltaEntry $LocalDomainAlist:= nil - $functorForm: local - $functorLocalParameters: local - $CheckVectorList: local + $functorForm: local := nil + $functorLocalParameters: local := nil + $CheckVectorList: local := nil --prevents CheckVector from printing out same message twice $getDomainCode: local -- code for getting views $insideFunctorIfTrue: local:= true - $functorsUsed: local --not currently used, finds dependent functors + $functorsUsed: local := nil --not currently used, finds dependent functors $setelt: local := "setShellEntry" - $TOP__LEVEL: local + $TOP__LEVEL: local := nil $genSDVar: local:= 0 originale:= $e [$op,:argl]:= form @@ -120,7 +120,7 @@ compDefineFunctor1(df, m,$e,$prefix,$formalArgList) == REMDUP [CADR x for x in attributeList] -->>-- next global initialized here, used by NRTgenAttributeAlist (NRUNOPT) $NRTattributeAlist: local := NRTgenInitialAttributeAlist attributeList - $NRTslot1Info: local --set in NRTmakeSlot1 called by NRTbuildFunctor + $NRTslot1Info: local := nil --set in NRTmakeSlot1 called by NRTbuildFunctor --this is used below to set $lisplibSlot1 global $NRTaddForm: local := nil -- see compAdd; NRTmakeSlot1 $NRTdeltaList: local := nil --list of misc. elts used in compiled fncts @@ -289,11 +289,11 @@ compDefineCapsuleFunction(df,m,oldE,$prefix,$formalArgList) == [lineNumber,:specialCases] := specialCases e := oldE --1. bind global variables - $form: local - $op: local + $form: local := nil + $op: local := nil $functionStats: local:= [0,0] $argumentConditionList: local - $finalEnv: local + $finalEnv: local := nil --used by ReplaceExitEtc to get a common environment $initCapsuleErrorCount: local:= #$semanticErrorStack $insideCapsuleFunctionIfTrue: local:= true -- cgit v1.2.3