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

Re: Using Macros in Lisp

    From:      Andrew L. M. Shalit <alms@cambridge.apple.com>
    This isn't what I consider the 'double evaluation' problem of macros.
    Consider the macro DOUBLE
    (defmacro double (number-form)
      `(+ ,number-form ,number-form))
    This yields
    (double 10)  ==>> (+ 10 10)
    But it also yields
    (double (incf foo))  ==>>  (+ (incf foo) (incf foo))

This is indeed an important thing to be careful to avoid in writing
macros, but it wasn't what I was referring to by ``double evaluation.''