[plt-scheme] Some more syntax-handling fun --- trying to extract all the definitions in an arbitrary file
At Mon, 20 Mar 2006 16:01:02 -0800 (PST), Danny Yoo wrote:
> I'm studying the reference manual about "Expanding Expressions to
> Primitive Syntax", and was wondering: is EXPAND generally the right tool
> to use to make sure the syntax is top-level-expr form before I start doing
> the preprocessing stuff? In what contexts might one want to use the other
> expand-* functions?
Use `expand-syntax' if you've already expanded the expression once, so
that it already has a starting lexical context, or if you've explicitly
given a syntax object a starting lexical context.
Use `expand-[syntax-]to-top-form' if you're dealing with non-module
code, and you need to find and flatten `begin's.
Use `expand-once' only for debugging.
Matthew