diff --git a/runtime.c b/runtime.c index 14866b6e..24280c4b 100644 --- a/runtime.c +++ b/runtime.c @@ -420,6 +420,8 @@ object Cyc_display(object x, FILE *port) if (obj_is_char(x)) {fprintf(port, "%c", obj_obj2char(x)); return quote_void;} switch (type_of(x)) {case macro_tag: + fprintf(port, "",(void *)((closure) x)->fn); + break; case closure0_tag: case closure1_tag: case closure2_tag: diff --git a/scheme/eval.sld b/scheme/eval.sld index 8ac83d3c..4773bb6e 100644 --- a/scheme/eval.sld +++ b/scheme/eval.sld @@ -375,13 +375,17 @@ (define (analyze exp) (cond ((self-evaluating? exp) (analyze-self-evaluating exp)) - ((quoted? exp) (analyze-quoted exp)) - ((quasiquoted? exp) (analyze-quasiquoted exp)) - ((variable? exp) (analyze-variable exp)) - ((assignment? exp) (analyze-assignment exp)) - ((definition? exp) (analyze-definition exp)) - ((if? exp) (analyze-if exp)) - ((lambda? exp) (analyze-lambda exp)) + ((quoted? exp) (analyze-quoted exp)) + ((quasiquoted? exp) (analyze-quasiquoted exp)) + ((variable? exp) (analyze-variable exp)) + ((assignment? exp) (analyze-assignment exp)) + ((definition? exp) (analyze-definition exp)) + ((if? exp) (analyze-if exp)) + ((lambda? exp) (analyze-lambda exp)) + ;; Expand macros + ((and (pair? exp) (macro? (car exp))) +(write (list 'debug 'macro exp)) + (analyze (apply (car exp) (cdr exp)))) ;; TODO: ideally, macro system would handle these next three ((tagged-list? 'let exp) (let ((vars (map car (cadr exp))) ;(let->bindings exp)))