From 4ee9e8c9ec410567f7904da3e3be59c06f059a6c Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 20 Jun 2010 06:39:48 +0000 Subject: * boot/tokens.boot (readOnly?): New builtin Boot function. * interp/c-util.boot (isLispSpecialVariable): Tidy. (transformToBackendCode): Likewise. --- src/interp/c-util.boot | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/interp') diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index 80016080..d3ed9926 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -1447,7 +1447,7 @@ pushLocalVariable x == isLispSpecialVariable x == s := PNAME x - s.0 = char "$" and #s > 1 and alphabetic? s.1 and not BOUNDP x + s.0 = char "$" and #s > 1 and alphabetic? s.1 and not readOnly? x noteSpecialVariable x == $SpecialVars := insert(x,$SpecialVars) @@ -1618,9 +1618,8 @@ transformToBackendCode x == body := skipDeclarations CDDR x -- Make it explicitly a sequence of statements if it is not a one liner. body := - stmt := first body - null rest body and - (atom stmt or first stmt = "SEQ" or not CONTAINED("EXIT",stmt)) => + body is [stmt] and + (atom stmt or stmt.op = "SEQ" or not CONTAINED("EXIT",stmt)) => body [simplifySEQ ["SEQ",:body]] $FluidVars := removeDuplicates nreverse $FluidVars @@ -1632,6 +1631,8 @@ 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']] [declareGlobalVariables fluids,:body] lvars ~= nil or needsPROG? body => [["PROG",lvars,["RETURN",:body]]] -- cgit v1.2.3