aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/algebra/defaults.spad.pamphlet16
-rw-r--r--src/algebra/modmon.spad.pamphlet2
-rw-r--r--src/interp/clam.boot6
-rw-r--r--src/interp/database.boot7
-rw-r--r--src/interp/define.boot21
-rw-r--r--src/interp/lisplib.boot2
-rw-r--r--src/interp/nruncomp.boot4
8 files changed, 20 insertions, 48 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ffe00cdb..1d954c73 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
+2011-08-25 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * interp/define.boot ($mutableDomain): Remove. Adjust users.
+ ($mutableDomains): Likewise.
+ * interp/database.boot (dbMutable?): Remove.
+ * interp/clam.boot (addToclam): Remove as unused.
+ * algebra/modmon.spad.pamphlet: Do not make MoMonic mutable.
+ * algebra/defaults.spad.pamphlet: Do not make RepeatedSquaring and
+ RepeatedDoubling, FiniteLinearAggregateSort mutable.
+
2011-08-24 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/daase.lisp (dbArity, dbInstanceCache): New accessors.
diff --git a/src/algebra/defaults.spad.pamphlet b/src/algebra/defaults.spad.pamphlet
index e5e47e40..fd88008b 100644
--- a/src/algebra/defaults.spad.pamphlet
+++ b/src/algebra/defaults.spad.pamphlet
@@ -16,11 +16,6 @@
++ Description:
++ Implements exponentiation by repeated squaring
++ RelatedOperations: expt
--- the following package is only instantiated over %
--- thus shouldn't be cached. We prevent it
--- from being cached by declaring it to be mutableDomains
-
-)bo PUSH('RepeatedSquaring, $mutableDomains)
RepeatedSquaring(S): Exports == Implementation where
S: SetCategory with
@@ -46,12 +41,6 @@ RepeatedSquaring(S): Exports == Implementation where
++ Description:
++ Implements multiplication by repeated addition
++ RelatedOperations: *
-
--- the following package is only instantiated over %
--- thus shouldn't be cached. We prevent it
--- from being cached by declaring it to be mutableDomains
-
-)bo PUSH('RepeatedDoubling, $mutableDomains)
RepeatedDoubling(S):Exports ==Implementation where
S: SetCategory with
@@ -80,11 +69,6 @@ RepeatedDoubling(S):Exports ==Implementation where
++ Description:
++ This package exports 3 sorting algorithms which work over
++ FiniteLinearAggregates.
--- the following package is only instantiated over %
--- thus shouldn't be cached. We prevent it
--- from being cached by declaring it to be mutableDomains
-
-)bo PUSH('FiniteLinearAggregateSort, $mutableDomains)
FiniteLinearAggregateSort(S, V): Exports == Implementation where
S: Type
diff --git a/src/algebra/modmon.spad.pamphlet b/src/algebra/modmon.spad.pamphlet
index 94872e38..be0e86e3 100644
--- a/src/algebra/modmon.spad.pamphlet
+++ b/src/algebra/modmon.spad.pamphlet
@@ -14,8 +14,6 @@
)abbrev domain MODMON ModMonic
++ Description:
++ This package \undocumented
--- following line prevents caching ModMonic
-)bo PUSH('ModMonic, $mutableDomains)
ModMonic(R,Rep): C == T
where
diff --git a/src/interp/clam.boot b/src/interp/clam.boot
index cdfb6e73..14a3d04b 100644
--- a/src/interp/clam.boot
+++ b/src/interp/clam.boot
@@ -513,12 +513,6 @@ numberOfEmptySlots cache==
if CAAR x='$failed then count:= count+1
count
-addToSlam([name,:argnames],shell) ==
- $mutableDomain => return nil
- null argnames => addToConstructorCache(name,nil,shell)
- args:= ['LIST,:[mkDevaluate a for a in argnames]]
- addToConstructorCache(name,args,shell)
-
addToConstructorCache(op,args,value) ==
['haddProp,'$ConstructorCache,MKQ op,args,['CONS,1,value]]
diff --git a/src/interp/database.boot b/src/interp/database.boot
index 3ba37506..06030e16 100644
--- a/src/interp/database.boot
+++ b/src/interp/database.boot
@@ -829,10 +829,3 @@ loadDBIfnecessary db ==
property(ctor,'LOADED) => db
loadLib ctor or return nil
constructorDB ctor
-
-++ Returns true if instantiations of the constructor
-++ defined by `db' should not be cached.
-dbMutable? db ==
- dbInstanceCache loadDBIfnecessary db = nil
-
-
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 379d751f..048efb2f 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -51,13 +51,6 @@ module define where
$newCompCompare := false
-++ List of mutable domains.
-$mutableDomains := nil
-
-++ True if the current constructor being compiled instantiates
-++ mutable domains or packages. Default is `false'.
-$mutableDomain := false
-
++ when non nil, holds the declaration number of a function in a capsule.
$suffix := nil
@@ -991,6 +984,7 @@ compDefineCategory2(form,signature,specialCases,body,m,e,
--Set in DomainSubstitutionFunction, used further down
-- 1.1 augment e to add declaration $: <form>
[$op,:argl] := $definition
+ dbInstanceCache(constructorDB $op) := true
e:= addBinding("$",[['mode,:$definition]],e)
-- 2. obtain signature
@@ -1305,7 +1299,6 @@ compDefineFunctor(df,m,e,prefix,fal) ==
$domainShell: local := nil -- holds the category of the object being compiled
$profileCompiler: local := true
$profileAlist: local := nil
- $mutableDomain: local := false
$LISPLIB = nil => compDefineFunctor1(df,m,e,prefix,fal)
compDefineLisplib(df,m,e,prefix,fal,'compDefineFunctor1)
@@ -1333,10 +1326,8 @@ compDefineFunctor1(df is ['DEF,form,signature,nils,body],
dbConstructorForm(constructorDB $op) := form
$formalArgList:= [:argl,:$formalArgList]
$pairlis: local := pairList(argl,$FormalMapVariableList)
- $mutableDomain: local :=
- -- all defaulting packages should have caching turned off
- isCategoryPackageName $op or symbolMember?($op,$mutableDomains)
- --true if domain has mutable state
+ -- all defaulting packages should have caching turned off
+ dbInstanceCache(constructorDB $op) := not isCategoryPackageName $op
signature':=
[signature.target,:[getArgumentModeOrMoan(a,form,$e) for a in argl]]
$functorForm := $form := [$op,:argl]
@@ -1398,7 +1389,9 @@ compDefineFunctor1(df is ['DEF,form,signature,nils,body],
[nil, ['Mapping, :signature'], originale]
body':= T.expr
- lamOrSlam:= if $mutableDomain then 'LAM else 'SPADSLAM
+ lamOrSlam :=
+ dbInstanceCache constructorDB $op = nil => 'LAM
+ 'SPADSLAM
fun:= compile applySubst($pairlis, [op',[lamOrSlam,argl,body']])
--The above statement stops substitutions gettting in one another's way
operationAlist := applySubst($pairlis,$lisplibOperationAlist)
@@ -2050,7 +2043,7 @@ compileConstructor1 (form:=[fn,[key,vl,:bodyl]]) ==
$clamList: local := nil
lambdaOrSlam :=
getConstructorKindFromDB fn = "category" => 'SPADSLAM
- $mutableDomain => 'LAMBDA
+ dbInstanceCache constructorDB fn = nil => 'LAMBDA
$clamList:=
[[fn,"$ConstructorCache",'domainEqualList,'count],:$clamList]
'LAMBDA
diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
index d448fd22..25b00464 100644
--- a/src/interp/lisplib.boot
+++ b/src/interp/lisplib.boot
@@ -573,7 +573,7 @@ finalizeLisplib(ctor,libName) ==
writeConstructorForm(ctor,form,$libFile)
writeKind(ctor,kind,$libFile)
writeConstructorModemap(ctor,removeZeroOne mm,$libFile)
- if not $mutableDomains then
+ if dbInstanceCache constructorDB ctor then
writeInstanceCache(ctor,$libFile)
$lisplibCategory := $lisplibCategory or mm.mmTarget
-- set to target of mm for package/domain constructors;
diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot
index 8f0fff7d..6171d4eb 100644
--- a/src/interp/nruncomp.boot
+++ b/src/interp/nruncomp.boot
@@ -660,9 +660,9 @@ NRToptimizeHas u ==
u
NRTaddToSlam([name,:argnames],shell) ==
- $mutableDomain => return nil
+ dbInstanceCache constructorDB name = nil => return nil
null argnames => addToConstructorCache(name,nil,shell)
- args:= ['%list,:ASSOCRIGHT $devaluateList]
+ args := ['%list,:ASSOCRIGHT $devaluateList]
addToConstructorCache(name,args,shell)
changeDirectoryInSlot1() == --called by buildFunctor