On Mon, Jan 5, 2009 at 11:48 PM, Lam Luu <[email protected]> wrote: > Hello all! > Given an S-Expression, (here is an example), is there any way to write a > script to determine whether or not that expression is a procedure-call or a > macro? If it is a macro call, is there anyway to expand it back to the > lowest level of special form possible? > Currently, the only way I know if is using expand-syntax procedure, but that > seems to be for interactive use only.
You can use `(macro? <symbol>)' to check whether a symbol is a macro, and run `macroexpand' (or `expand' in chicken 4) repeatedly for s-expressions that have a macro name as first element. Full expansion of arbitrary expressions will need a code-walker, though. cheers, felix _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
