~ chicken-core (chicken-5) 06d7fd21a4651b7850381061c8ad9dc8ea0f5835
commit 06d7fd21a4651b7850381061c8ad9dc8ea0f5835
Author: felix <felix@call-with-current-continuation.org>
AuthorDate: Thu Jan 20 20:24:28 2011 +0100
Commit: felix <felix@call-with-current-continuation.org>
CommitDate: Thu Jan 20 20:24:28 2011 +0100
build-node-graph accepts nodes; substitution in specializer
diff --git a/scrutinizer.scm b/scrutinizer.scm
index ffd62613..be4fbd7b 100755
--- a/scrutinizer.scm
+++ b/scrutinizer.scm
@@ -695,5 +695,8 @@
(define (specialize-node! node template)
(let ((args (cdr (node-subexpressions node))))
(define (subst x)
- ...) ;XXX
- (copy-node! (subst (build-node-graph template)) node)))
+ (cond ((integer? x) (list-ref args (sub1 x)))
+ ((not (pair? x)) x)
+ ((eq? 'quote (car x)) x) ; to handle numeric constants
+ (else (cons (subst (car x)) (subst (cdr x))))))
+ (copy-node! (build-node-graph (subst template)) node)))
diff --git a/support.scm b/support.scm
index 34cf3400..cb9c100a 100644
--- a/support.scm
+++ b/support.scm
@@ -474,6 +474,7 @@
(let ([count 0])
(define (walk x)
(cond ((symbol? x) (varnode x))
+ ((node? x) x)
((not-pair? x) (bomb "bad expression" x))
((symbol? (car x))
(case (car x)
Trap