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

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

Re: elisp errors


From: Barry Margolin
Subject: Re: elisp errors
Date: Sat, 31 Jan 2009 21:58:06 -0500
User-agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X)

In article <mailman.6394.1233456736.26697.help-gnu-emacs@gnu.org>,
 Samuel Wales <samologist@gmail.com> wrote:

> On Thu, Jan 22, 2009 at 20:48, Barry Margolin <barmar@alum.mit.edu> wrote:
> > (dotimes (i 100)
> >  (c-indent-command)
> >  (move-beginning-of-line 0)
> >  (next-line 1)
> >  (message "fin partielle"))
> 
> Question: is this the usual approach?  Seems a little strange to bind
> i when it's not used, especially since emacs lisp uses dynamic extent
> by default.
> 
> A minor note: this might require 'cl, (an excellent package).
> 
> (For those who don't know, Barry is a very experienced Common Lisper.)

AFAIK, there's no variant of DOTIMES that doesn't require you to provide 
a variable to hold the counter.  And even if there were, it would simply 
have to have a hidden variable of its own, although it could use a 
gensym to avoid potential variable shadowing problems.

But there's virtually no chance that there's a global variable named i 
that you'll shadow with this.  Just don't do something like:

(dotimes (goal-column 100)
  ...)

and you should be OK.

-- 
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]