No macros in Python

Anders J. Munch andersjm at dancontrol.dk
Mon Dec 16 08:27:06 EST 2002


"Mike Meyer" <mwm at mired.org> wrote:
> 
> Macros are a general-purpose mechanism. There are lots of things they
> let you do. Lazy evaluation, infinite lists, CLOS, short-circuit
> booleans, and so on. 

No, s-expressions buy you those things, not macros.  Macros don't
provide expressiveness, they provide speed and some convenience, say
to let you write:
  (define-method methname (arg list) (form))
instead of 
  (define-method 'methname '(arg list) '(form))

Or maybe that should be
  (define-method methname '(arg list) '(form))
Since the macro is obscuring the true nature of the construct, I can't
readily tell what the role of the method name is.

- Anders






More information about the Python-list mailing list