aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/algebra/strap/BOOLEAN.lsp2
-rw-r--r--src/algebra/strap/CHAR.lsp2
-rw-r--r--src/algebra/strap/DFLOAT.lsp2
-rw-r--r--src/algebra/strap/ILIST.lsp2
-rw-r--r--src/algebra/strap/INT.lsp2
-rw-r--r--src/algebra/strap/ISTRING.lsp2
-rw-r--r--src/algebra/strap/LIST.lsp2
-rw-r--r--src/algebra/strap/NNI.lsp2
-rw-r--r--src/algebra/strap/OUTFORM.lsp2
-rw-r--r--src/algebra/strap/PI.lsp2
-rw-r--r--src/algebra/strap/SINT.lsp2
-rw-r--r--src/algebra/strap/SYMBOL.lsp2
-rw-r--r--src/algebra/strap/VECTOR.lsp2
-rw-r--r--src/interp/c-util.boot18
-rw-r--r--src/interp/compiler.boot1
16 files changed, 34 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f24a8bd8..2ce1b27a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-07 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * 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.
+
2010-08-28 Gabriel Dos Reis <gdr@cs.tamu.edu>
* utils/Makefile.in ($(oa_target_oalib)): Create contaning
diff --git a/src/algebra/strap/BOOLEAN.lsp b/src/algebra/strap/BOOLEAN.lsp
index df73f473..2cd01a42 100644
--- a/src/algebra/strap/BOOLEAN.lsp
+++ b/src/algebra/strap/BOOLEAN.lsp
@@ -162,9 +162,9 @@
(COND ((NOT #0#) (HREM |$ConstructorCache| '|Boolean|)))))))))
(DEFUN |Boolean;| ()
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET ((|dv$| (LIST '|Boolean|)) ($ (|newShell| 39))
(|pv$| (|buildPredVector| 0 0 NIL)))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|Boolean| NIL (CONS 1 $))
diff --git a/src/algebra/strap/CHAR.lsp b/src/algebra/strap/CHAR.lsp
index 7e15370a..719559af 100644
--- a/src/algebra/strap/CHAR.lsp
+++ b/src/algebra/strap/CHAR.lsp
@@ -201,9 +201,9 @@
((NOT #0#) (HREM |$ConstructorCache| '|Character|)))))))))
(DEFUN |Character;| ()
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET ((|dv$| (LIST '|Character|)) ($ (|newShell| 58))
(|pv$| (|buildPredVector| 0 0 NIL)))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|Character| NIL (CONS 1 $))
diff --git a/src/algebra/strap/DFLOAT.lsp b/src/algebra/strap/DFLOAT.lsp
index 0736ea62..1915550c 100644
--- a/src/algebra/strap/DFLOAT.lsp
+++ b/src/algebra/strap/DFLOAT.lsp
@@ -856,9 +856,9 @@
((NOT #0#) (HREM |$ConstructorCache| '|DoubleFloat|)))))))))
(DEFUN |DoubleFloat;| ()
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET ((|dv$| (LIST '|DoubleFloat|)) ($ (|newShell| 164))
(|pv$| (|buildPredVector| 0 0 NIL)))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|DoubleFloat| NIL (CONS 1 $))
diff --git a/src/algebra/strap/ILIST.lsp b/src/algebra/strap/ILIST.lsp
index ff6511d6..bcc6d8bd 100644
--- a/src/algebra/strap/ILIST.lsp
+++ b/src/algebra/strap/ILIST.lsp
@@ -431,6 +431,7 @@
((NOT #2#) (HREM |$ConstructorCache| '|IndexedList|)))))))))
(DEFUN |IndexedList;| (|#1| |#2|)
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET* ((|dv$1| (|devaluate| |#1|)) (|dv$2| (|devaluate| |#2|))
(|dv$| (LIST '|IndexedList| |dv$1| |dv$2|))
($ (|newShell| 86))
@@ -468,7 +469,6 @@
(|HasCategory| |#1|
(LIST '|Evalable|
(|devaluate| |#1|))))))))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|IndexedList| (LIST |dv$1| |dv$2|)
diff --git a/src/algebra/strap/INT.lsp b/src/algebra/strap/INT.lsp
index 3be4c61e..65c5e2b0 100644
--- a/src/algebra/strap/INT.lsp
+++ b/src/algebra/strap/INT.lsp
@@ -512,9 +512,9 @@
(COND ((NOT #0#) (HREM |$ConstructorCache| '|Integer|)))))))))
(DEFUN |Integer;| ()
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET ((|dv$| (LIST '|Integer|)) ($ (|newShell| 140))
(|pv$| (|buildPredVector| 0 0 NIL)))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|Integer| NIL (CONS 1 $))
diff --git a/src/algebra/strap/ISTRING.lsp b/src/algebra/strap/ISTRING.lsp
index 3aaf5260..fc760f24 100644
--- a/src/algebra/strap/ISTRING.lsp
+++ b/src/algebra/strap/ISTRING.lsp
@@ -663,6 +663,7 @@
((NOT #1#) (HREM |$ConstructorCache| '|IndexedString|)))))))))
(DEFUN |IndexedString;| (|#1|)
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET* ((|dv$1| (|devaluate| |#1|))
(|dv$| (LIST '|IndexedString| |dv$1|)) ($ (|newShell| 100))
(|pv$| (|buildPredVector| 0 0
@@ -703,7 +704,6 @@
'(|SetCategory|))
(|HasCategory| (|Character|)
(LIST '|Evalable| '(|Character|))))))))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|IndexedString| (LIST |dv$1|)
diff --git a/src/algebra/strap/LIST.lsp b/src/algebra/strap/LIST.lsp
index 5ab75d13..cac9fdbd 100644
--- a/src/algebra/strap/LIST.lsp
+++ b/src/algebra/strap/LIST.lsp
@@ -181,6 +181,7 @@
(COND ((NOT #1#) (HREM |$ConstructorCache| '|List|)))))))))
(DEFUN |List;| (|#1|)
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET* ((|dv$1| (|devaluate| |#1|)) (|dv$| (LIST '|List| |dv$1|))
($ (|newShell| 70))
(|pv$| (|buildPredVector| 0 0
@@ -218,7 +219,6 @@
(|HasCategory| |#1|
(LIST '|Evalable|
(|devaluate| |#1|))))))))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|List| (LIST |dv$1|) (CONS 1 $))
diff --git a/src/algebra/strap/NNI.lsp b/src/algebra/strap/NNI.lsp
index b355751f..efe37d37 100644
--- a/src/algebra/strap/NNI.lsp
+++ b/src/algebra/strap/NNI.lsp
@@ -57,9 +57,9 @@
(HREM |$ConstructorCache| '|NonNegativeInteger|)))))))))
(DEFUN |NonNegativeInteger;| ()
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET ((|dv$| (LIST '|NonNegativeInteger|)) ($ (|newShell| 22))
(|pv$| (|buildPredVector| 0 0 NIL)))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|NonNegativeInteger| NIL
diff --git a/src/algebra/strap/OUTFORM.lsp b/src/algebra/strap/OUTFORM.lsp
index 21ec89fa..01827b30 100644
--- a/src/algebra/strap/OUTFORM.lsp
+++ b/src/algebra/strap/OUTFORM.lsp
@@ -991,9 +991,9 @@
((NOT #0#) (HREM |$ConstructorCache| '|OutputForm|)))))))))
(DEFUN |OutputForm;| ()
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET ((|dv$| (LIST '|OutputForm|)) ($ (|newShell| 150))
(|pv$| (|buildPredVector| 0 0 NIL)))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|OutputForm| NIL (CONS 1 $))
diff --git a/src/algebra/strap/PI.lsp b/src/algebra/strap/PI.lsp
index 8f17450f..29f7ada0 100644
--- a/src/algebra/strap/PI.lsp
+++ b/src/algebra/strap/PI.lsp
@@ -21,9 +21,9 @@
(HREM |$ConstructorCache| '|PositiveInteger|)))))))))
(DEFUN |PositiveInteger;| ()
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET ((|dv$| (LIST '|PositiveInteger|)) ($ (|newShell| 16))
(|pv$| (|buildPredVector| 0 0 NIL)))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|PositiveInteger| NIL (CONS 1 $))
diff --git a/src/algebra/strap/SINT.lsp b/src/algebra/strap/SINT.lsp
index 540a317b..701ae24d 100644
--- a/src/algebra/strap/SINT.lsp
+++ b/src/algebra/strap/SINT.lsp
@@ -523,9 +523,9 @@
((NOT #0#) (HREM |$ConstructorCache| '|SingleInteger|)))))))))
(DEFUN |SingleInteger;| ()
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET ((|dv$| (LIST '|SingleInteger|)) ($ (|newShell| 114))
(|pv$| (|buildPredVector| 0 0 NIL)))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|SingleInteger| NIL (CONS 1 $))
diff --git a/src/algebra/strap/SYMBOL.lsp b/src/algebra/strap/SYMBOL.lsp
index 008cf1e5..fc1b66ba 100644
--- a/src/algebra/strap/SYMBOL.lsp
+++ b/src/algebra/strap/SYMBOL.lsp
@@ -636,9 +636,9 @@
(COND ((NOT #0#) (HREM |$ConstructorCache| '|Symbol|)))))))))
(DEFUN |Symbol;| ()
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET ((|dv$| (LIST '|Symbol|)) ($ (|newShell| 165))
(|pv$| (|buildPredVector| 0 0 NIL)))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|Symbol| NIL (CONS 1 $))
diff --git a/src/algebra/strap/VECTOR.lsp b/src/algebra/strap/VECTOR.lsp
index 717a24ec..b4bf5d7d 100644
--- a/src/algebra/strap/VECTOR.lsp
+++ b/src/algebra/strap/VECTOR.lsp
@@ -41,6 +41,7 @@
(COND ((NOT #1#) (HREM |$ConstructorCache| '|Vector|)))))))))
(DEFUN |Vector;| (|#1|)
+ (DECLARE (SPECIAL |$ConstructorCache|))
(LET* ((|dv$1| (|devaluate| |#1|)) (|dv$| (LIST '|Vector| |dv$1|))
($ (|newShell| 36))
(|pv$| (|buildPredVector| 0 0
@@ -85,7 +86,6 @@
(|HasCategory| |#1|
(LIST '|Evalable|
(|devaluate| |#1|))))))))
- (DECLARE (SPECIAL |$ConstructorCache|))
(|setShellEntry| $ 0 |dv$|)
(|setShellEntry| $ 3 |pv$|)
(|haddProp| |$ConstructorCache| '|Vector| (LIST |dv$1|) (CONS 1 $))
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"],_