[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using Macros in Lisp
- To: info-macl@cambridge.apple.com
- Subject: Re: Using Macros in Lisp
- From: Kevin Gallagher <Gallagher@gilgamesh.cs.umass.edu>
- Date: Fri, 8 Mar 91 14:31:04 EST
- In-reply-to: <9103081810.AA24543@cambridge.apple.com>
- Reply-to: Gallagher@gilgamesh.cs.umass.edu
- Sender: Gallagher@Gilgamesh
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.''