aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/interp/compiler.boot18
-rw-r--r--src/interp/define.boot2
-rw-r--r--src/interp/info.boot12
4 files changed, 27 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 01aabf89..2a0897d3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
+2009-02-21 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * interp/compiler.boot (compRetractAlternative): Don't store
+ pointers to the environment.
+ (compRecoverAlternative): Likewise.
+ (compMatch): Likewise.
+ (compIterator): Likewise.
+ (compIteratorV): Likewise.
+ * interp/define.boot (checkRepresentation): Likewise.
+ * interp/info.boot (actOnInfo): Likewise.
+
2009-02-19 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/sys-utility.boot (%hostByteOrder): Make a function.
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index b5faa805..06f7c318 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -1827,7 +1827,7 @@ compRetractAlternative(x,t,stmt,m,s,T) ==
else return stackAndThrow('"%1 is not retractable to %2bp",[s,t])
-- 2. Now declare `x'.
[.,.,e] := compMakeDeclaration(x,t,e) or return nil
- e := put(x,"value",[genSomeVariable(),t,e],e)
+ e := put(x,"value",[genSomeVariable(),t,$noEnv],e)
-- 3. Compile body of the retract pattern.
stmtT := comp(stmt,m,e) or return
stackAndThrow('"could not compile %1b under mode %2pb",[stmt,m])
@@ -1862,7 +1862,7 @@ compRecoverAlternative(x,t,stmt,m,s,T) ==
caseCode := ["EQUAL",["devaluate",t],["objMode",y]]
-- 2. Declare `x'.
[.,.,e] := compMakeDeclaration(x,t,e) or return nil
- e := put(x,"value",[genSomeVariable(),t,e],e)
+ e := put(x,"value",[genSomeVariable(),t,$noEnv],e)
-- 3. Compile body of alternative
stmtT := comp(stmt,m,e) or return
stackAndThrow('"could not compile %1b under mode %2pb",[stmt,m])
@@ -1884,7 +1884,7 @@ compMatch(["%Match",subject,altBlock],m,e) ==
[se,sm,e] := comp(subject,$EmptyMode,e) or return nil
sn := GENSYM()
[.,.,e] := compMakeDeclaration(sn,sm,e) or return nil
- e := put(sn,"value",[genSomeVariable(),sm,e],e)
+ e := put(sn,"value",[genSomeVariable(),sm,$noEnv],e)
-- 2. compile alternatives.
altsCode := nil
catchAllCount := 0
@@ -2044,7 +2044,7 @@ compIterator(it,e) ==
stackMessage('"mode: %1pb must be a list of some mode",[m])
if null get(x,"mode",e) then [.,.,e]:=
compMakeDeclaration(x,mUnder,e) or return nil
- e:= put(x,"value",[genSomeVariable(),mUnder,e],e)
+ e:= put(x,"value",[genSomeVariable(),mUnder,$noEnv],e)
[y'',m'',e] := coerce([y',m,e], mOver) or return nil
[["IN",x,y''],e]
it is ["ON",x,y] =>
@@ -2056,7 +2056,7 @@ compIterator(it,e) ==
stackMessage('"mode: %1pb must be a list of other modes",[m])
if null get(x,"mode",e) then [.,.,e]:=
compMakeDeclaration(x,m,e) or return nil
- e:= put(x,"value",[genSomeVariable(),m,e],e)
+ e:= put(x,"value",[genSomeVariable(),m,$noEnv],e)
[y'',m'',e] := coerce([y',m,e], mOver) or return nil
[["ON",x,y''],e]
it is ["STEP",index,start,inc,:optFinal] =>
@@ -2076,7 +2076,7 @@ compIterator(it,e) ==
if null get(index,"mode",e) then [.,.,e]:=
compMakeDeclaration(index,indexmode,
(final' => final'.env; inc'.env)) or return nil
- e:= put(index,"value",[genSomeVariable(),indexmode,e],e)
+ e:= put(index,"value",[genSomeVariable(),indexmode,$noEnv],e)
if final' then optFinal:= [final'.expr]
[["ISTEP",index,start'.expr,inc'.expr,:optFinal],e]
[start,.,e]:=
@@ -2095,7 +2095,7 @@ compIterator(it,e) ==
$Integer
if null get(index,"mode",e) then [.,.,e]:=
compMakeDeclaration(index,indexmode,e) or return nil
- e:= put(index,"value",[genSomeVariable(),indexmode,e],e)
+ e:= put(index,"value",[genSomeVariable(),indexmode,$noEnv],e)
[["STEP",index,start,inc,:optFinal],e]
it is ["WHILE",p] =>
[p',m,e]:=
@@ -2160,7 +2160,7 @@ compIteratorV(it,e) ==
if null get(index,"mode",e) then [.,.,e]:=
compMakeDeclaration(index,indexmode,final'.env) or
return nil
- e:= put(index,"value",[genSomeVariable(),indexmode,e],e)
+ e:= put(index,"value",[genSomeVariable(),indexmode,$noEnv],e)
[["ISTEP",index,start'.expr,inc'.expr,final'.expr],e]
[start,.,e]:=
comp(start,$Integer,e) or return
@@ -2177,7 +2177,7 @@ compIteratorV(it,e) ==
$Integer
if null get(index,"mode",e) then [.,.,e]:=
compMakeDeclaration(index,indexmode,e) or return nil
- e:= put(index,"value",[genSomeVariable(),indexmode,e],e)
+ e:= put(index,"value",[genSomeVariable(),indexmode,$noEnv],e)
[["STEP",index,start,inc,final],e]
nil
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 7c95510e..e8b23955 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -260,7 +260,7 @@ checkRepresentation(addForm,body,env) ==
base := compForMode(domainRep,$EmptyMode,env) or
stackAndThrow('"1b is not a domain",[domainRep])
$useRepresentationHack := false
- env := put("Rep","value",base,env)
+ env := put("Rep","value",removeEnv base,env)
-- ??? Maybe we should also make Rep available as macro?
env
diff --git a/src/interp/info.boot b/src/interp/info.boot
index 878b78b0..23a15dfc 100644
--- a/src/interp/info.boot
+++ b/src/interp/info.boot
@@ -214,11 +214,11 @@ actOnInfo(u,$e) ==
$e:= actOnInfo(v,$e)
$e
u is ["ATTRIBUTE",name,att] =>
- [vval,vmode,venv]:= GetValue name
+ [vval,vmode,.]:= GetValue name
compilerMessage('"augmenting %1: %2p", [name,["ATTRIBUTE",att]])
key:= if CONTAINED("$",vmode) then "domain" else name
cat:= ["CATEGORY",key,["ATTRIBUTE",att]]
- $e:= put(name,"value",[vval,mkJoin(cat,vmode),venv],$e)
+ $e:= put(name,"value",[vval,mkJoin(cat,vmode),$noEnv],$e)
--there is nowhere %else that this sort of thing exists
u is ["SIGNATURE",name,operator,modemap,:q] =>
kind :=
@@ -230,14 +230,14 @@ actOnInfo(u,$e) ==
name = "$" => [kind,name,-1]
[kind,name,substitute('$,name,modemap)]
$e:= addModemap(operator,name,modemap,true,implem,$e)
- [vval,vmode,venv]:= GetValue name
+ [vval,vmode,.]:= GetValue name
compilerMessage('"augmenting %1: %2p",
[name,["SIGNATURE",operator,modemap,:q]])
key:= if CONTAINED("$",vmode) then "domain" else name
cat:= ["CATEGORY",key,["SIGNATURE",operator,modemap,:q]]
- $e:= put(name,"value",[vval,mkJoin(cat,vmode),venv],$e)
+ $e:= put(name,"value",[vval,mkJoin(cat,vmode),$noEnv],$e)
u is ["has",name,cat] =>
- [vval,vmode,venv]:= GetValue name
+ [vval,vmode,.]:= GetValue name
cat=vmode => $e --stating the already known
u:= compMakeCategoryObject(cat,$e) =>
--we are adding information about a category
@@ -255,7 +255,7 @@ actOnInfo(u,$e) ==
if not MEMQ(name,$functorLocalParameters) then
$functorLocalParameters:=[:$functorLocalParameters,name]
compilerMessage('"augmenting %1: %2p", [name,cat])
- $e:= put(name,"value",[vval,mkJoin(cat,vmode),venv],$e)
+ $e:= put(name,"value",[vval,mkJoin(cat,vmode),$noEnv],$e)
SAY("extension of ",vval," to ",cat," ignored")
$e
systemError ['"actOnInfo",u]