Debugging syntax-rules

This commit is contained in:
Justin Ethier 2016-09-01 18:51:27 -04:00
parent ef3ea81542
commit 68c8f54d7a

View file

@ -1229,6 +1229,8 @@
(vars '()) (vars '())
(k (lambda (vars) (k (lambda (vars)
(list _cons (expand-template tmpl vars) #f)))) (list _cons (expand-template tmpl vars) #f))))
;(Cyc-write (list 'PATTERN p 'vars vars) (current-output-port))
;(Cyc-display "\n" (current-output-port))
(let ((v (next-symbol "v."))) (let ((v (next-symbol "v.")))
(list (list
_let (list (list v x)) _let (list (list v x))
@ -1354,6 +1356,8 @@
(else free)))) (else free))))
(define (expand-template tmpl vars) (define (expand-template tmpl vars)
(let lp ((t tmpl) (dim 0)) (let lp ((t tmpl) (dim 0))
;(Cyc-write (list 'TMPL tmpl 'vars vars) (current-output-port))
;(Cyc-display "\n" (current-output-port))
(cond (cond
((identifier? t) ((identifier? t)
(cond (cond