This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Debuging macros?
- From: Luis Casillas <luis at casillas dot org>
- To: dift2245 <dift2245 at iro dot umontreal dot ca>
- Cc: kawa at sources dot redhat dot com
- Date: Sat, 6 Oct 2007 12:07:52 -0700
- Subject: Re: Debuging macros?
- References: <47077887.6040909@iro.umontreal.ca>
I sometimes use the following macro to debug macro expansion:
(define-syntax syntax-case-debug
(syntax-rules ()
((_ stx (literal ...) clause ...)
(let ((result (syntax-case stx (literal ...) clause ...)))
(format #t "syntax-case: ~S~%=> ~S~%~%" stx result)
result))))
I replace the suspect uses of syntax-case in the source files with
syntax-case-debug, and then I just recompile; each time an expansion
is performed, a line is printed detailing it.
It's not a readable as one would hope, as you will probably notice,
but it does help.
On Oct 6, 2007, at 4:59 AM, dift2245 wrote:
Hi Per, Hi all!
I searched a bit in the list's archives and found a message (in
2002) matching a
question I have: How can I print the expansion of a syntax-case
macro? Your
answer to the message that the only way at the time was to hack the
kawa
sources, but you also mentionned that you were looking for a way to
achieve
macro debuging.
Now, has such a macro debug faclitity been added to kawa? If so,
how does it work?
Thanks!
David