From 9c53b933216af4ae6c7233384ace756572dcb597 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 28 Apr 2011 04:45:25 +0000 Subject: * boot/ast.boot (bfReduceCollect): Delegate to bfDoCollect if op is append or append!. --- src/ChangeLog | 5 +++++ src/boot/ast.boot | 2 ++ src/boot/strap/ast.clisp | 13 ++++++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index c76fe320..b8c36c5d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-04-27 Gabriel Dos Reis + + * boot/ast.boot (bfReduceCollect): Delegate to bfDoCollect if + op is append or append!. + 2011-04-27 Gabriel Dos Reis * boot/ast.boot (bfCollect): Use bfDoCollect. diff --git a/src/boot/ast.boot b/src/boot/ast.boot index bc444a4e..15a720bc 100644 --- a/src/boot/ast.boot +++ b/src/boot/ast.boot @@ -351,6 +351,8 @@ bfReduceCollect(op,y)== a := op is ["QUOTE",:.] => second op op + a is "append!" => bfDoCollect(body,itl,'lastNode,'skipNil) + a is "append" => bfDoCollect(['copyList,body],itl,'lastNode,'skipNil) op := bfReName a init := a has SHOETHETA or op has SHOETHETA bfOpReduce(op,init,body,itl) diff --git a/src/boot/strap/ast.clisp b/src/boot/strap/ast.clisp index c4249a0d..9597b66d 100644 --- a/src/boot/strap/ast.clisp +++ b/src/boot/strap/ast.clisp @@ -484,9 +484,16 @@ ((AND (CONSP |op|) (EQ (CAR |op|) 'QUOTE)) (CADR |op|)) (T |op|))) - (SETQ |op| (|bfReName| |a|)) - (SETQ |init| (OR (GET |a| 'SHOETHETA) (GET |op| 'SHOETHETA))) - (|bfOpReduce| |op| |init| |body| |itl|)) + (COND + ((EQ |a| '|append!|) + (|bfDoCollect| |body| |itl| '|lastNode| '|skipNil|)) + ((EQ |a| '|append|) + (|bfDoCollect| (LIST '|copyList| |body|) |itl| '|lastNode| + '|skipNil|)) + (T (SETQ |op| (|bfReName| |a|)) + (SETQ |init| + (OR (GET |a| 'SHOETHETA) (GET |op| 'SHOETHETA))) + (|bfOpReduce| |op| |init| |body| |itl|)))) (T (SETQ |seq| (COND ((NULL |y|) (|bfTuple| NIL)) (T (CADR |y|)))) (|bfReduce| |op| (|bfTupleConstruct| |seq|))))))) -- cgit v1.2.3