From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Building Emacs overflowed pure space Date: Thu, 20 Jul 2006 11:26:18 -0400 Message-ID: References: <7dbe73ed0607180138x35e9d9bft3e42f20cb369795c@mail.gmail.com> <200607181929.k6IJTZN9028639@jane.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1153409254 15880 80.91.229.2 (20 Jul 2006 15:27:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Jul 2006 15:27:34 +0000 (UTC) Cc: teirllm@dms.auburn.edu, rms@gnu.org, ralphm@members.fsf.org, emacs-devel@gnu.org, mituharu@math.s.chiba-u.ac.jp, mathias.dahl@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 20 17:27:27 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 1G3aQF-0007Pi-7L for ged-emacs-devel@m.gmane.org; Thu, 20 Jul 2006 17:26:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G3aQE-0007hI-KR for ged-emacs-devel@m.gmane.org; Thu, 20 Jul 2006 11:26:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G3aQ0-0007gn-Um for emacs-devel@gnu.org; Thu, 20 Jul 2006 11:26:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G3aPy-0007g9-0d for emacs-devel@gnu.org; Thu, 20 Jul 2006 11:26:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G3aPx-0007g2-Tx for emacs-devel@gnu.org; Thu, 20 Jul 2006 11:26:25 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G3aQ9-0005WV-Va; Thu, 20 Jul 2006 11:26:38 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 01AA12CE9BA; Thu, 20 Jul 2006 11:26:24 -0400 (EDT) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 961B7445C; Thu, 20 Jul 2006 11:26:18 -0400 (EDT) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 814EA4C6DEA; Thu, 20 Jul 2006 11:26:18 -0400 (EDT) Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Thu, 20 Jul 2006 10:14:18 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca 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:57376 Archived-At: >>> So it is safe to take the cdr at the end. >> >> Maybe it is, but it will subtly change the semantics in case the loop body >> modifies the list it's loooping over. > But that subtle difference already exists between the cl and subr versions. > IMO, we better make them consistent. > As you point out, it is not safe to move the `cdr' if BODY modifies > the list. But we could just document this fact in the docstring, e.g.: > dolist is a Lisp macro in `subr.el'. > (dolist (var list [result]) body...) > Loop over a list. > Evaluate BODY with VAR bound to each car from LIST, in turn. > Then evaluate RESULT to get return value, default nil. > The result is undefined if BODY modifies the list. Sure. But I currently see no reason to prefer the cl-macs.el behavior over the subr.el one (AFAICT my suggested code is just as efficient as the cl-macs.el one), so I'm not sure whether we should change cl-macs.el or subr.el's behavior. Stefan