chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Print source after macro expansion?


From: Casey Rodarmor
Subject: [Chicken-users] Print source after macro expansion?
Date: Tue, 29 Oct 2013 00:39:10 -0700

Hi chickenemers,

I would like to read a file containing macro definitions and a source file, and output the source file after macro expansion, but before evaluation.

So, for example, if I have the following macro in macro.scm:

(define-syntax foo
  (syntax-rules ()
    ((foo) (+ 1 1))))

And I have the following in the source.scm:

(* (foo) 10)

I would like to run "mystery-command macro.scm source.scm" and get:

(* (+ 1 1) 10)

I have been poking around, and it seems like there are a few things that almost do what I want, like the top-level command ",x" and (expand) from unit expand.

Is there an easy way to do this? Like with some mysterious flag to csi or csc that just outputs its macro-expanded input?

Thanks!

Best,
Casey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]