all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Mathias Dahl" <mathias.dahl@gmail.com>
Cc: Lennart Borgman <lennart.borgman.073@student.lu.se>, emacs-devel@gnu.org
Subject: Re: dotimes-with-progress-reporter doc string lacks SPEC
Date: Thu, 6 Jul 2006 23:37:24 +0200	[thread overview]
Message-ID: <7dbe73ed0607061437g5c1b59a3o87d6a28cf14c0ac6@mail.gmail.com> (raw)
In-Reply-To: <200607070028.12058.pogonyshev@gmx.net>

> Well, the same applies to `dotimes'.

This is interesting. Here is the source for the `dotimes' macro:

(defmacro dotimes (spec &rest body)
  "Loop a certain number of times.
Evaluate BODY with VAR bound to successive integers from 0, inclusive,
to COUNT, exclusive.  Then evaluate RESULT to get return value, default
nil.

\(fn (VAR COUNT [RESULT]) BODY...)"
  (let ((temp (make-symbol "--cl-dotimes-temp--")))
    (list 'block nil
	  (list* 'let (list (list temp (nth 1 spec)) (list (car spec) 0))
		 (list* 'while (list '< (car spec) temp)
			(append body (list (list 'incf (car spec)))))
		 (or (cdr (cdr spec)) '(nil))))))

It mentiones `spec', which I think Lennart wants to know more about.

When loaded (or is it compiled?) though (I just made a dummy call to
it), the documentation string says this:

dotimes is a Lisp macro in `cl-macs'.
(dotimes (VAR COUNT [RESULT]) BODY...)

Loop a certain number of times.
Evaluate BODY with VAR bound to successive integers from 0, inclusive,
to COUNT, exclusive.  Then evaluate RESULT to get return value, default
nil.

Not mentioning any `spec' at all.

Anyone care to explain this magic?

  reply	other threads:[~2006-07-06 21:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06 20:44 dotimes-with-progress-reporter doc string lacks SPEC Lennart Borgman
2006-07-06 21:28 ` Paul Pogonyshev
2006-07-06 21:37   ` Mathias Dahl [this message]
2006-07-06 21:40     ` David Kastrup
2006-07-06 21:48     ` Lennart Borgman
2006-07-07  5:58       ` Mathias Dahl
2006-07-07 11:02 ` Eli Zaretskii
2006-07-07 12:07   ` Lennart Borgman
2006-07-07 15:19     ` Eli Zaretskii
2006-07-07 15:34       ` Lennart Borgman
2006-07-07 15:52         ` Eli Zaretskii
2006-07-07 16:10           ` Lennart Borgman
2006-07-07 19:31 ` Richard Stallman
2006-07-07 22:29   ` Lennart Borgman

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=7dbe73ed0607061437g5c1b59a3o87d6a28cf14c0ac6@mail.gmail.com \
    --to=mathias.dahl@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman.073@student.lu.se \
    /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.