From 8ffa40b0f97e90033c1be9e97430e0dee02f4e01 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 7 Sep 2010 17:09:38 +0000 Subject: * 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. --- src/interp/c-util.boot | 18 +++++++++++------- src/interp/compiler.boot | 1 - 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src/interp') 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"],_ -- cgit v1.2.3