Python Macros: Use Cases?
If Python had a macro facility similar to Lisp/Scheme (something like MetaPython ), how would you use it? If you are a Lisp/Scheme programmer, what sorts of things do you use macros for (other than things that have a clear syntactic parallel in Python such as a while loop)? Some examples of lisp macros: ITERATE which is a funny and extensible loop facility CL-YACC / FUCC that are parser generators that generate parsers at compile time CL-WHO which allows specifying html documents with static and dynamic parts Parenscript which is a javascript code generator Various simple code-wrappers, e.g.,