all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Barry Margolin <barmar@alum.mit.edu>
To: help-gnu-emacs@gnu.org
Subject: Re: elisp errors
Date: Sat, 31 Jan 2009 21:58:06 -0500	[thread overview]
Message-ID: <barmar-39DD5E.21580631012009@mara100-84.onlink.net> (raw)
In-Reply-To: mailman.6394.1233456736.26697.help-gnu-emacs@gnu.org

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


      parent reply	other threads:[~2009-02-01  2:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-22 16:56 elisp errors synhedionn
2009-01-23  3:48 ` Barry Margolin
2009-01-23 20:27   ` synhedionn
2009-01-24  4:19     ` Barry Margolin
2009-02-01  2:52   ` Samuel Wales
     [not found]   ` <mailman.6394.1233456736.26697.help-gnu-emacs@gnu.org>
2009-02-01  2:58     ` Barry Margolin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=barmar-39DD5E.21580631012009@mara100-84.onlink.net \
    --to=barmar@alum.mit.edu \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.