aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2010-09-07 17:09:38 +0000
committerdos-reis <gdr@axiomatics.org>2010-09-07 17:09:38 +0000
commit8ffa40b0f97e90033c1be9e97430e0dee02f4e01 (patch)
tree661ea46f065f1fde44317ad2a5f1d8611cd713f8 /src/interp
parent871c6f7c1422155b3263455e291e6eaace27af87 (diff)
downloadopen-axiom-8ffa40b0f97e90033c1be9e97430e0dee02f4e01.tar.gz
* interp/c-util.boot (massageBackendCode): Remove conditional on
$NEWSPAD since it always true. Keep note of Lisp-level special variable even if it is set with SETQ. (transformToBackendCode): Declare special variables before fluid and local variables. * interp/compiler.boot: Don't compile SETQ forms as if they were Spad codes.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot18
-rw-r--r--src/interp/compiler.boot1
2 files changed, 11 insertions, 8 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index c72da0df..e6926855 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1528,11 +1528,8 @@ massageBackendCode x ==
x.first := "MAKEPROP-SAY"
u in '(DCQ RELET PRELET SPADLET SETQ %LET) =>
if u ~= 'DCQ and u ~= 'SETQ then
- $NEWSPAD or $FUNAME in $traceletFunctions =>
- nconc(x,$FUNNAME__TAIL)
- x.first := "LETT"
- $TRACELETFLAG => x.first := "/TRACE-LET"
- u = "%LET" => x.first := "SPADLET"
+ nconc(x,$FUNNAME__TAIL)
+ x.first := "LETT"
massageBackendCode CDDR x
if not (u in '(SETQ RELET)) then
IDENTP second x => pushLocalVariable second x
@@ -1540,6 +1537,11 @@ massageBackendCode x ==
PUSH(CADADR x, $FluidVars)
x.rest.first := CADADR x
MAPC(function pushLocalVariable, LISTOFATOMS second x)
+ -- Even if user used Lisp-level instructions to assign to
+ -- this variable, we still want to note that it is a Lisp-level
+ -- special variable.
+ u = 'SETQ and isLispSpecialVariable second x =>
+ noteSpecialVariable second x
IDENTP u and GET(u,"ILAM") ~= nil =>
x.first := eval u
massageBackendCode x
@@ -1640,8 +1642,10 @@ transformToBackendCode x ==
fluids ~= nil =>
lvars ~= nil or needsPROG? body =>
[["PROG",lvars,declareGlobalVariables fluids, ["RETURN",:body]]]
- body is [[op,bindings,:body']] and op in '(LET LET_*) =>
- [[op,bindings,declareGlobalVariables fluids,:body']]
+ body is [[op,inits,:body']] and op in '(LET LET_*)
+ and $FluidVars ~= nil =>
+ [declareGlobalVariables $SpecialVars,
+ [op,inits,declareGlobalVariables fluids,:body']]
[declareGlobalVariables fluids,:body]
lvars ~= nil or needsPROG? body =>
[["PROG",lvars,["RETURN",:body]]]
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 7d4b8809..501935c1 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -2660,7 +2660,6 @@ for x in [["|", :"compSuchthat"],_
["REPEAT", :"compRepeatOrCollect"],_
["return", :"compReturn"],_
["SEQ", :"compSeq"],_
- ["SETQ", :"compSetq"],_
["SubDomain", :"compSubDomain"],_
["SubsetCategory", :"compSubsetCategory"],_
["Union", :"compCat"],_