Added debug output

This commit is contained in:
Justin Ethier 2015-08-24 22:59:37 -04:00
parent 82ba3fe18e
commit 2c2c5b9da1
2 changed files with 18 additions and 7 deletions

View file

@ -67,7 +67,7 @@
;; Assume evaluated macro
(newline)
(display "/* ")
(display (list 'evaluating-macro macro exp))
(display (list 'evaluating-macro macro exp env-vars env-vals))
(display " */ ")
(eval
(list

View file

@ -444,10 +444,6 @@
(loop (car procs) (cdr procs))))
(define (pre-analyze-application exp a-env)
(newline)
(display "/* ")
(display (list 'pre-analyze exp))
(display " */ ")
;; Notes:
;;
;; look up symbol in env, and expand if it is a macro
@ -469,13 +465,28 @@
(expand (lambda (macro-op)
(newline)
(display "/* ")
(display (list 'expand macro-op (operands exp)))
(display (list 'expand macro-op (operands exp)
(car exp)
(macro? var)
(compound-macro? var)
(macro? macro-op)
(Cyc-get-cvar (cadr var)) ;; this is what is analyzed
(compound-macro? op)
))
(display " */ ")
(analyze (apply macro-op
(list (cons macro-op (operands exp))
(list (cons (car exp) (operands exp))
(lambda (sym) sym)
(lambda (a b) (eq? a b))))
a-env))))
(newline)
(display "/* ")
(display (list 'pre-analyze
(macro? var)
(compound-macro? var)
(compound-macro? op)
exp))
(display " */ ")
(cond
;; compiled macro
((macro? var)