[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Macros and anonymous functions
Bruce Lewis wrote:
>
>....
>
> This assumes the macro expands to a block of statements. If it expands
> to an expression that might be nested in another expression, you would
> have to either allow nesting of the def within the expression or have
> the macro expander pull all necessary defs out to before the enclosing
> statement, giving them unique names as necessary. Having anonymous
> functions would make the macro expander implementation simpler and more
> understandable.
Python has anonymous functions. They have some syntactic limitations
that make them less powerful than Lisp's. Most Python programmers
consider that a good thing. By definition, you wouldn't add a macro
feature to Python without adding syntax. Therefore the syntactic
limitations of Python's anonymous function syntax would be irrelevant.
Paul Prescod