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: Macro expansion


On 04/21/2009 11:37 AM, Dan Stanger wrote:
Is it possible to view macro expanded source, that is to take a source
file, have the macros expanded, and output the processed source?

If you want to just see that the "processed output" looks like, try --debug-print-expr. That shows you the Expression tree in pretty-printed form.

However, this format is not S-expressions, and it's designed
for me to figure out what the compiler is doing, rather than
to look like "core Scheme".

Unfortunately, there is no way to output the processed source
because there is no such thing.  Macro expansion is combined
with and interleaved with converting to Expression format.
In fact, you can write a macro that returns an Expression
- that is how the (if ...) form is implemented - see the
definition in kawa/lib/prim_syntax.scm.  Likewise
try-finally and synchronized in syntax.scm.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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