diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/interp/define.boot | 24 | ||||
-rw-r--r-- | src/interp/nruncomp.boot | 15 |
3 files changed, 23 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index fb6f2e80..dd1031b7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-11-22 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * interp/define.boot (assignCapsuleFunctionSlot): Move from + nruncomp.boot. Rename from NRTassignCapsuleFunctionSlot. Take + first parameter as a DB. Adjust callers. + (compDefineCapsuleFunction): Tidy. + 2011-11-21 Gabriel Dos Reis <gdr@cs.tamu.edu> * interp/nruncomp.boot (getLocalIndex): Rename from NRTgetLocalIndex. diff --git a/src/interp/define.boot b/src/interp/define.boot index df1f1dd4..537a891e 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -49,8 +49,6 @@ module define where --% -$newCompCompare := false - ++ when non nil, holds the declaration number of a function in a capsule. $suffix := nil @@ -1712,6 +1710,20 @@ orderByDependency(vl,dl) == dl := dl' removeDuplicates reverse! orderedVarList --ordered so ith is indep. of jth if i < j +++ Subroutine of compDefineCapsuleFunction. +assignCapsuleFunctionSlot(db,op,sig) == + opSig := [op,sig] + [.,.,implementation] := NRTisExported? opSig or return nil + --if opSig is not exported, it is local and need not be assigned + if $insideCategoryPackageIfTrue then + sig := substitute('$,second dbConstructorForm db,sig) + sig := [getLocalIndex x for x in sig] + opModemapPair := [op,['_$,:sig],["T",implementation]] + valuePosition(opModemapPair,$NRTdeltaList) => nil --already there + $NRTdeltaList:= [opModemapPair,:$NRTdeltaList] + $NRTdeltaListComp := [nil,:$NRTdeltaListComp] + $NRTdeltaLength := $NRTdeltaLength+1 + compDefineCapsuleFunction(db,df is ['DEF,form,signature,body], m,$e,$prefix,$formalArgList) == e := $e @@ -1727,7 +1739,7 @@ compDefineCapsuleFunction(db,df is ['DEF,form,signature,body], $CapsuleModemapFrame: local:= e $CapsuleDomainsInScope: local:= get("$DomainsInScope","special",e) $insideExpressionIfTrue: local:= true - $returnMode:= m + $returnMode: local := m -- Change "^" to "**" in definitions. All other places have -- been changed before we get here. if form is ["^",:.] then @@ -1778,10 +1790,7 @@ compDefineCapsuleFunction(db,df is ['DEF,form,signature,body], noteCapsuleFunctionDefinition($op,signature', makePredicate $predl) T := CATCH('compCapsuleBody, compOrCroak(body,rettype,e)) or [$ClearBodyToken,rettype,e] - NRTassignCapsuleFunctionSlot($op,signature') - if $newCompCompare=true then - SAY '"The old compiler generates:" - prTriple T + assignCapsuleFunctionSlot(db,$op,signature') -- A THROW to the above CATCH occurs if too many semantic errors occur -- see stackSemanticError catchTag:= MKQ gensym() @@ -1793,7 +1802,6 @@ compDefineCapsuleFunction(db,df is ['DEF,form,signature,body], $functorStats:= addStats($functorStats,$functionStats) --7. give operator a 'value property - val:= [fun,signature',e] [fun,['Mapping,:signature'],$e] getSignatureFromMode(form,e) == diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot index a3c4dce1..4903e046 100644 --- a/src/interp/nruncomp.boot +++ b/src/interp/nruncomp.boot @@ -270,21 +270,6 @@ getLocalIndex item == saveNRTdeltaListComp.first := compEntry saveIndex -NRTassignCapsuleFunctionSlot(op,sig) == ---called from compDefineCapsuleFunction - opSig := [op,sig] - [.,.,implementation] := NRTisExported? opSig or return nil - --if opSig is not exported, it is local and need not be assigned - if $insideCategoryPackageIfTrue then - sig := substitute('$,second($functorForm),sig) - sig := [getLocalIndex x for x in sig] - opModemapPair := [op,['_$,:sig],["T",implementation]] - valuePosition(opModemapPair,$NRTdeltaList) => nil --already there - $NRTdeltaList:= [opModemapPair,:$NRTdeltaList] - $NRTdeltaListComp := [nil,:$NRTdeltaListComp] - $NRTdeltaLength := $NRTdeltaLength+1 - - ++ NRTaddInner should call following function instead of getLocalIndex ++ This would prevent putting spurious items in $NRTdeltaList NRTinnerGetLocalIndex x == |