(define-macro (when test body)
`(if ,test
(begin
,@body)))
(define (foo x)
(when (= x 0)
(write 'yo)))
Gambit v4.0.0
> (load "x")
"C:\\Jazz\\dev\\jazz\\x.scm"
> (pp foo)
(lambda (x) (if (= x 0) (begin write 'yo)))
>
C:\Jazz\dev\jazz>gsc -debug x
C:\Jazz\dev\jazz>gsc
Gambit v4.0.0
> (load "x")
"C:\\Jazz\\dev\\jazz\\x.o1"
> (pp foo)
(##lambda (x) (when (= x 0) (write 'yo)))
>
Guillaume
I was wondering if anyone could suggest a method of debugging
"define-macro" expressions so that I can see what is actually being
generated by the macro system (e.g. by preventing evaluation of the
resulting macro, and printing it)? Otherwise I get a cryptic messages
like "unbound unquote", and "ill-formed expression", but without any
hints what is causing the grief in the generated code.
Thanks,
Christopher Diggins
_______________________________________________
Gambit-list mailing list
Gambit-list@iro.umontreal.ca
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list