From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jari Newsgroups: gmane.emacs.bugs Subject: bug#7408: Linux patchutils: Development of the project? Date: Wed, 17 Nov 2010 06:47:29 +0200 Message-ID: <20101117044729.GG17341@picasso.cante.net> References: <1213200935.4147.62.camel@cyberelk.elk> <87pqu59d16.fsf@picasso.cante.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1289970868 12929 80.91.229.12 (17 Nov 2010 05:14:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 17 Nov 2010 05:14:28 +0000 (UTC) Cc: 7408@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 17 06:14:24 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PIaLe-0005Dk-SO for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Nov 2010 06:14:23 +0100 Original-Received: from localhost ([127.0.0.1]:41624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIaLe-0004Qx-44 for geb-bug-gnu-emacs@m.gmane.org; Wed, 17 Nov 2010 00:14:22 -0500 Original-Received: from [140.186.70.92] (port=45576 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PIaLX-0004Qi-AE for bug-gnu-emacs@gnu.org; Wed, 17 Nov 2010 00:14:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PIaLV-0003tL-Vr for bug-gnu-emacs@gnu.org; Wed, 17 Nov 2010 00:14:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:33530) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PIaLV-0003tG-SJ for bug-gnu-emacs@gnu.org; Wed, 17 Nov 2010 00:14:13 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PIZrK-0002WD-1M; Tue, 16 Nov 2010 23:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: jari Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Nov 2010 04:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7408 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7408-submit@debbugs.gnu.org id=B7408.12899689609669 (code B ref 7408); Wed, 17 Nov 2010 04:43:01 +0000 Original-Received: (at 7408) by debbugs.gnu.org; 17 Nov 2010 04:42:40 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PIZqx-0002Vu-GV for submit@debbugs.gnu.org; Tue, 16 Nov 2010 23:42:39 -0500 Original-Received: from emh06.mail.saunalahti.fi ([62.142.5.116]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PIZqu-0002Vp-E1 for 7408@debbugs.gnu.org; Tue, 16 Nov 2010 23:42:37 -0500 Original-Received: from saunalahti-vams (vs3-10.mail.saunalahti.fi [62.142.5.94]) by emh06-2.mail.saunalahti.fi (Postfix) with SMTP id 9A444C7CD9; Wed, 17 Nov 2010 06:47:36 +0200 (EET) Original-Received: from emh07.mail.saunalahti.fi ([62.142.5.117]) by vs3-10.mail.saunalahti.fi ([62.142.5.94]) with SMTP (gateway) id A02C9E95D9F; Wed, 17 Nov 2010 06:47:36 +0200 Original-Received: from picasso.cante.net (a91-155-187-216.elisa-laajakaista.fi [91.155.187.216]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id 942A11C6385; Wed, 17 Nov 2010 06:47:33 +0200 (EET) Original-Received: from jaalto by picasso.cante.net with local (Exim 4.72) (envelope-from ) id 1PIZvd-0000SN-Rn; Wed, 17 Nov 2010 06:47:29 +0200 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jaalto@picasso.cante.net X-SA-Exim-Scanned: No (on picasso.cante.net); SAEximRunCond expanded to false X-Antivirus: VAMS X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 16 Nov 2010 23:43:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:41682 Archived-At: On 2010-11-16 17:21, Stefan Monnier wrote: | >> subr.el has had a dolist definition since at least Emacs 21.x; ie 9 years. | >> Therefore this cannot be a major issue in practice. | > In my book it is still a bug, no matter how many years ago this bug were | > introduced: | | > a: - To have two different implementations of same function. | > b: - To not be able to rely on uniform behavior. | | You look at it the wrong way: the problem is not with dolist, it's that | you use `return' which is a special form that's not defined in standard | Elisp. As I understand it, the fact that there are forms like these nowadays: unless when ... dolist was because people used these constructs from CL so many time that they were "re-introduced" directly in subr.el in order to prevent loading CL. However re-implementation of CL equivalent of 'dolist' did not meet all the criteria. The 'return' has been integral part of 'dolist' since the start. | After (require 'cl), `return' gets defined and things work as you | expect. The implementation in subr.el::dolist does not have any support for 'return'. It is not that 'return' gets defined, but what happens is that loading CL clobbers that current definition pf 'dolist' by overwiting it with its own implementation: Two different implementation, that are not compatible. $ diff -u 1.subr.el 2.cl-macs.el | grep -vE ";|declare" --- 1.subr.el 2010-11-17 06:31:53.000000000 +0200 +++ 2.cl-macs.el 2010-11-17 06:32:31.000000000 +0200 @@ -1,19 +1,15 @@ (defmacro dolist (spec &rest body) "Loop over a list. -Evaluate BODY with VAR bound to each car from LIST, in turn. +Evaluate BODY with VAR bound to each `car' from LIST, in turn. Then evaluate RESULT to get return value, default nil. \(fn (VAR LIST [RESULT]) BODY...)" - (let ((temp '--dolist-tail--)) - `(let ((,temp ,(nth 1 spec)) - ,(car spec)) - (while ,temp - (setq ,(car spec) (car ,temp)) - ,@body - (setq ,temp (cdr ,temp))) - ,@(if (cdr (cdr spec)) - `((setq ,(car spec) nil) ,@(cdr (cdr spec))))))) + (let ((temp (make-symbol "--cl-dolist-temp--"))) >> + (list 'block nil + (list* 'let (list (list temp (nth 1 spec)) (car spec)) + (list* 'while temp (list 'setq (car spec) (list 'car temp)) + (append body (list (list 'setq temp + (list 'cdr temp))))) + (if (cdr (cdr spec)) + (cons (list 'setq (car spec) nil) (cdr (cdr spec))) + '(nil)))))) Naturally, loading CL also defines other things. But the fundamental problem is two incompatible dolist implementations. A possible solution: - Make subr.el::dolist repect return-block (nil-block) - have 'return' autoloaded If user uses: - Plain dolist, nothing more is loaded (subr.el is used) - "return", it triggers autoloading CL (or parts of it). Jari