Re: gensym in macro definition
- From: Guybrush Threepwood <spambak@xxxxxxxxxxx>
- Date: Thu, 31 Aug 2006 07:30:53 +0200
On Thu, 31 Aug 2006 04:55:17 +0000, Stephen Compall wrote:
Guybrush Threepwood wrote:
(defmacro n-of (n expression)
(let ((i (gensym)))
`(loop for ,i from 1 to ,n
collect ,expression)))
I wonder if the gensym is really necessary.
It is necessary for the code you have output. For extra fun find the
loop-clause that will let LOOP do this without an explicit variable.
(defmacro n-of2 (n expression)
`(loop repeat ,n
collect ,expression))
--
"Don't worry about people stealing your ideas. If your ideas are any
good, you'll have to ram them down people's throats."
-- Howard Aiken
.
- References:
- gensym in macro definition
- From: Guybrush Threepwood
- Re: gensym in macro definition
- From: Stephen Compall
- gensym in macro definition
- Prev by Date: Re: LISP V APL?
- Next by Date: Re: Java is going to have closures.
- Previous by thread: Re: gensym in macro definition
- Next by thread: Re: gensym in macro definition
- Index(es):