help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to put this in a macro


From: Barry Margolin
Subject: Re: How to put this in a macro
Date: Tue, 04 May 2010 15:45:04 -0000
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article 
<0b67cc27-1c96-459b-a8f8-435cef946281@q15g2000yqj.googlegroups.com>,
 José A. Romero L. <escherdragon@gmail.com> wrote:

> On 17 Kwi, 13:40, Cecil Westerhof <Ce...@decebal.nl> wrote:
> (...)
> >            (if (> (symbol-value ,start-sym) (symbol-value ,end-sym))
> >                (let ((temp (symbol-value ,start-sym)))
> >                  (set ,start-sym (symbol-value ,end-sym))
> >                  (set ,end-sym   temp)))))
> >
> > I also make sure now that start is not after end.
> (...)
> 
> Hmm, be careful with lets inside macros - this will work OK until one
> of the variables you try to set is named precisely "temp" (no lexical
> scope, remember?).

Another reason why his version should be a function.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


reply via email to

[Prev in Thread] Current Thread [Next in Thread]