[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Replacement for Common Lisp's GENSYM in Emacs Lisp
From: |
Stefan Monnier |
Subject: |
Re: Replacement for Common Lisp's GENSYM in Emacs Lisp |
Date: |
Tue, 04 May 2010 15:41:50 -0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.93 (gnu/linux) |
>> (defmacro dotimes (xl e)
>> (let ((x (car xl))
>> (l (cadr xl)))
>> `(let ((body (lambda (,x) ,e))
>> (list ,l))
>> (while (consp list)
>> (funcall body (car list))
>> (setq list (cdr list))))))
>>
>> Notice how the expressions `l' and `e' are evaluated in a context where
>> neither of `body', nor `list' exist. No need for gensym.
> What makes you think that body and list aren't bound in e?
Nothing, but luckily it doesn't make any difference whether they are
or not.
Stefan
Re: Replacement for Common Lisp's GENSYM in Emacs Lisp, Pascal J. Bourguignon, 2010/05/04