From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Mathias Dahl" Newsgroups: gmane.emacs.devel Subject: Re: dotimes-with-progress-reporter doc string lacks SPEC Date: Thu, 6 Jul 2006 23:37:24 +0200 Message-ID: <7dbe73ed0607061437g5c1b59a3o87d6a28cf14c0ac6@mail.gmail.com> References: <44AD7613.1060805@student.lu.se> <200607070028.12058.pogonyshev@gmx.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1152221868 10405 80.91.229.2 (6 Jul 2006 21:37:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Jul 2006 21:37:48 +0000 (UTC) Cc: Lennart Borgman , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 06 23:37:46 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FybXa-0000ow-8Y for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 23:37:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FybXZ-0006EM-H3 for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 17:37:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FybXO-0006CJ-9E for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:37:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FybXM-0006Bv-L9 for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:37:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FybXM-0006Br-In for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:37:28 -0400 Original-Received: from [64.233.182.186] (helo=nf-out-0910.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FybXd-0007On-Bw for emacs-devel@gnu.org; Thu, 06 Jul 2006 17:37:45 -0400 Original-Received: by nf-out-0910.google.com with SMTP id p48so62637nfa for ; Thu, 06 Jul 2006 14:37:24 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=i0y1Had5az0U/BKKDL8gLY7F5KJiX4mZscwMPflgin+aqsmEHbbkGDPuOj3xD8e51yJXrihIs7Jav/wcjUrjZfkif3kMpSQCMLk+wzkWGyjApNJEViORDi7MKLQ2cxdJeomdrt+FezL3QhAX9aLru1Y7IGum+qHpeFDAVfekBFo= Original-Received: by 10.49.21.3 with SMTP id y3mr724509nfi; Thu, 06 Jul 2006 14:37:24 -0700 (PDT) Original-Received: by 10.48.248.13 with HTTP; Thu, 6 Jul 2006 14:37:24 -0700 (PDT) Original-To: "Paul Pogonyshev" In-Reply-To: <200607070028.12058.pogonyshev@gmx.net> Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56663 Archived-At: > 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?