~ chicken-core (chicken-5) 16ca275815f78bf6338e17938e5e16078cff085a
commit 16ca275815f78bf6338e17938e5e16078cff085a
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Mon Mar 14 12:34:50 2011 +0100
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Mon Mar 14 12:34:50 2011 +0100
simpler qq simplification; runtests removes some stale files
diff --git a/expand.scm b/expand.scm
index cd3b823c..2c4b65d3 100644
--- a/expand.scm
+++ b/expand.scm
@@ -1389,11 +1389,12 @@
(cond ((eq? n 0)
(##sys#check-syntax 'unquote x '(_ _))
(car tail))
- (else (list '##sys#cons `(##core#quote ,%unquote)
- (walk tail (fx- n 1)) ) )))
+ (else
+ `(##sys#cons (##core#quote ,%unquote)
+ (walk tail (fx- n 1)) ) )))
((c %quasiquote head)
- (list '##sys#cons `(##core#quote ,%quasiquote)
- (walk tail (fx+ n 1)) ) )
+ `(##sys#cons (##core#quote ,%quasiquote)
+ (walk tail (fx+ n 1)) ) )
((and (pair? head) (c %unquote-splicing (car head)))
(cond ((eq? n 0)
(##sys#check-syntax 'unquote-splicing head '(_ _))
@@ -1406,21 +1407,14 @@
(else
`(##sys#cons ,(walk head n) ,(walk tail n)) ) ) ) ) ) )
(define (simplify x)
- (cond ((match-expression x '(##sys#cons a (##core#quote ())) '(a))
- => (lambda (env) (simplify `(##sys#list ,(cdr (assq 'a env))))) )
- ((match-expression x '(##sys#cons a (##sys#list . b)) '(a b))
- => (lambda (env)
- (let ((bxs (assq 'b env)))
- (if (fx< (length bxs) 32)
- (simplify `(##sys#list ,(cdr (assq 'a env)) ,@(cdr bxs) ) )
- x) ) ) )
- ((match-expression x '(##sys#cons a b) '(a b))
+ (cond ((match-expression x '(##sys#cons a b) '(a b))
=> (lambda (env)
`(##sys#cons
,(simplify (cdr (assq 'a env)))
,(simplify (cdr (assq 'b env))))))
((match-expression x '(##sys#append a (##core#quote ())) '(a))
- => (lambda (env) (cdr (assq 'a env))) )
+ => (lambda (env)
+ (simplify (cdr (assq 'a env))) ))
(else x) ) )
(##sys#check-syntax 'quasiquote form '(_ _))
(walk (cadr form) 0) ) ) ) )
diff --git a/tests/runtests.sh b/tests/runtests.sh
index 4f6677d4..545c086e 100644
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -39,6 +39,8 @@ if test -n "$MSYSTEM"; then
cp ../libchicken.dll .
fi
+rm -f a.out *.exe *.import.* *.so
+
compile="../csc -compiler $CHICKEN -v -I.. -L.. -include-path .. -o a.out"
compile_s="../csc -s -compiler $CHICKEN -v -I.. -L.. -include-path .."
interpret="../csi -n -include-path .."
Trap