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

Re: Macros and anonymous functions



Paul Prescod <paul@prescod.net> writes:

> my_new_construct:
> 	some_code_block()
> 
> All we need to do to make this work is to have the my_new_construct
> suite be evaluated as if it were a "def" rather than a "lambda".

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.

-- 
<brlewis@[(if (brl-related? message)    ; Bruce R. Lewis
              "users.sourceforge.net"   ; http://brl.sourceforge.net/
              "alum.mit.edu")]>