aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog8
-rw-r--r--src/boot/ast.boot8
-rw-r--r--src/boot/includer.boot4
-rw-r--r--src/boot/parser.boot4
-rw-r--r--src/boot/scanner.boot4
-rw-r--r--src/boot/strap/ast.clisp4
-rw-r--r--src/boot/translator.boot2
7 files changed, 23 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ca73592e..2add1045 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,13 @@
2010-05-06 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * boot/ast.boot: Translate assignment to head and tail of a list.
+ Remove explicit uses of RPLACA and RPLACD.
+ * boot/includer.boot: Likewise.
+ * boot/scanner.boot: Likewise.
+ * boot/translator.boot: Likewise.
+
+2010-05-06 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* interp/wi2.boot: Replace INTEGERP, STRINGP, SYMBOLP, CONSP with
integer?, string?, symbol?, and cons? respectively.
* interp/wi1.boot: Likewise.
diff --git a/src/boot/ast.boot b/src/boot/ast.boot
index 04a2888b..97bd8e92 100644
--- a/src/boot/ast.boot
+++ b/src/boot/ast.boot
@@ -622,7 +622,7 @@ bfISReverse(x,a) ==
x is ['CONS,:.] =>
null third x => ['CONS,second x, a]
y := bfISReverse(third x, NIL)
- RPLACA(CDDR y,['CONS,second x,a])
+ y.rest.rest.first := ['CONS,second x,a]
y
bpSpecificErrorHere '"Error in bfISReverse"
bpTrap()
@@ -904,7 +904,7 @@ shoeCompTran1 x==
U:=car x
U = "QUOTE" => nil
x is ["L%T",l,r] =>
- RPLACA (x,"SETQ")
+ x.first := "SETQ"
shoeCompTran1 r
IDENTP l =>
not bfBeginsDollar l=>
@@ -918,7 +918,7 @@ shoeCompTran1 x==
$fluidVars:=
MEMQ(second l,$fluidVars)=>$fluidVars
cons(second l,$fluidVars)
- RPLACA (rest x,second l)
+ x.rest.first := second l
U in '(PROG LAMBDA) =>
newbindings:=nil
for y in second x repeat
@@ -959,6 +959,8 @@ defSETELT(var,sel,expr)==
y := symbol? sel and sel has SHOESELFUNCTION
y =>
integer? y => ["SETF",["ELT",var,y],expr]
+ y = "CAR" => ["RPLACA",var,expr]
+ y = "CDR" => ["RPLACD",var,expr]
["SETF",[y,var],expr]
["SETF",["ELT",var,sel],expr]
diff --git a/src/boot/includer.boot b/src/boot/includer.boot
index a2d10d25..18b8a58d 100644
--- a/src/boot/includer.boot
+++ b/src/boot/includer.boot
@@ -180,8 +180,8 @@ bStreamNull x==
null x or x is ["nullstream",:.] => true
while x is ["nonnullstream",:.] repeat
st:=apply(second x,CDDR x)
- RPLACA(x,first st)
- RPLACD(x,rest st)
+ x.first := first st
+ x.rest := rest st
x is ["nullstream",:.]
bMap(f,x) ==
diff --git a/src/boot/parser.boot b/src/boot/parser.boot
index 56bd4d73..aa250b80 100644
--- a/src/boot/parser.boot
+++ b/src/boot/parser.boot
@@ -101,12 +101,12 @@ bpPop1()==
bpPop2()==
a:=second $stack
- RPLACD($stack,CDDR $stack)
+ $stack.rest := CDDR $stack
a
bpPop3()==
a:=third $stack
- RPLACD(rest $stack,CDDDR $stack)
+ $stack.rest.rest := CDDDR $stack
a
bpIndentParenthesized f==
diff --git a/src/boot/scanner.boot b/src/boot/scanner.boot
index 1c731116..eb164ba9 100644
--- a/src/boot/scanner.boot
+++ b/src/boot/scanner.boot
@@ -49,8 +49,8 @@ dqUnit s==
dqAppend(x,y)==
null x => y
null y => x
- RPLACD (rest x,first y)
- RPLACD (x, rest y)
+ x.rest.rest := first y
+ x.rest := rest y
x
dqConcat ld==
diff --git a/src/boot/strap/ast.clisp b/src/boot/strap/ast.clisp
index 7f7e52ce..f9a2ecec 100644
--- a/src/boot/strap/ast.clisp
+++ b/src/boot/strap/ast.clisp
@@ -931,7 +931,7 @@
(COND
((NULL (CADDR |x|)) (LIST 'CONS (CADR |x|) |a|))
(T (SETQ |y| (|bfISReverse| (CADDR |x|) NIL))
- (RPLACA (CDDR |y|) (LIST 'CONS (CADR |x|) |a|)) |y|)))
+ (RPLACA (CDR (CDR |y|)) (LIST 'CONS (CADR |x|) |a|)) |y|)))
(T (|bpSpecificErrorHere| "Error in bfISReverse") (|bpTrap|))))))
(DEFUN |bfIS1| (|lhs| |rhs|)
@@ -1662,6 +1662,8 @@
(|y| (COND
((INTEGERP |y|)
(LIST 'SETF (LIST 'ELT |var| |y|) |expr|))
+ ((EQ |y| 'CAR) (LIST 'RPLACA |var| |expr|))
+ ((EQ |y| 'CDR) (LIST 'RPLACD |var| |expr|))
(T (LIST 'SETF (LIST |y| |var|) |expr|))))
(T (LIST 'SETF (LIST 'ELT |var| |sel|) |expr|)))))))
diff --git a/src/boot/translator.boot b/src/boot/translator.boot
index c49c8209..502c0c02 100644
--- a/src/boot/translator.boot
+++ b/src/boot/translator.boot
@@ -397,7 +397,7 @@ translateToplevelExpression expr ==
-- at toplevel.
for t in expr' repeat
t is ["DECLARE",:.] =>
- RPLACA(t,"DECLAIM")
+ t.first := "DECLAIM"
expr' :=
#expr' > 1 => ["PROGN",:expr']
first expr'