unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman.073@student.lu.se>
Cc: emacs-devel@gnu.org, Paul Pogonyshev <pogonyshev@gmx.net>
Subject: Re: dotimes-with-progress-reporter doc string lacks SPEC
Date: Thu, 06 Jul 2006 23:48:22 +0200	[thread overview]
Message-ID: <44AD8526.5040700@student.lu.se> (raw)
In-Reply-To: <7dbe73ed0607061437g5c1b59a3o87d6a28cf14c0ac6@mail.gmail.com>

Mathias Dahl wrote:
>> 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?

Hm, thanks. I can see the pattern. Searching elisp Info I found the 
explanation in "(elisp) Function Documentation":

   The last line of the documentation string can specify calling
   conventions different from the actual function arguments.  Write text
  like this:

     \(fn ARGLIST)

  ...

  parent reply	other threads:[~2006-07-06 21:48 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
2006-07-06 21:40     ` David Kastrup
2006-07-06 21:48     ` Lennart Borgman [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=44AD8526.5040700@student.lu.se \
    --to=lennart.borgman.073@student.lu.se \
    --cc=emacs-devel@gnu.org \
    --cc=pogonyshev@gmx.net \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).