This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Debuging macros?



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]