[Python-Dev] defmacro

Stephen J. Turnbull stephen at xemacs.org
Wed Apr 27 13:28:55 CEST 2005


>>>>> "Greg" == Greg Ewing <greg.ewing at canterbury.ac.nz> writes:

    Greg> I didn't claim that people would feel compelled to eliminate
    Greg> all uses of lambda; only that, in those cases where they
    Greg> *do* feel so compelled, they might not if lambda weren't
    Greg> such a long word.

Sure, I understood that.  It's just that my feeling is that lambda
can't "just quote a suite", it brings lots of other semantic baggage
with it.

Anyway, with dynamic scope, we can eliminate lambda, can't we?  Just
pass the suites as quoted lists of forms, compute the macro expansion,
and eval it.  So it seems to me that the central issue us scoping, not
preventing evaluation of the suites.  In Lisp, macros are a way of
temporarily enabling certain amounts of dynamic scoping for all
variables, without declaring them "special".  It is very convenient
that they don't evaluate their arguments, but that is syntactic sugar,
AFAICT.

In other words, it's the same idea as the "collapse" keyword that was
proposed, but with different rules about what gets collapsed, when.

-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.


More information about the Python-Dev mailing list