From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Achim Gratz Newsgroups: gmane.emacs.bugs Subject: bug#14422: 24.3; Eager Macro Expansion Date: Thu, 30 May 2013 21:38:21 +0200 Organization: Linux Private Site Message-ID: <87ehcojm1e.fsf@Rainer.invalid> References: <87hahz82rh.fsf@Rainer.invalid> <87mwrcjqlu.fsf@Rainer.invalid> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1369942786 18896 80.91.229.3 (30 May 2013 19:39:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 May 2013 19:39:46 +0000 (UTC) To: 14422@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 30 21:39:45 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ui8hM-0004ru-MU for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 May 2013 21:39:44 +0200 Original-Received: from localhost ([::1]:40724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui8hM-0005K1-AR for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 May 2013 15:39:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui8hE-0005JX-LC for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:39:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui8h9-0004vW-93 for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:39:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui8h9-0004vO-5t for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:39:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Ui8ib-0005Q8-LV for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:41:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87hahz82rh.fsf@Rainer.invalid> Resent-From: Achim Gratz Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2013 19:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14422 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136994282920794 (code B ref -1); Thu, 30 May 2013 19:41:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 May 2013 19:40:29 +0000 Original-Received: from localhost ([127.0.0.1]:42872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ui8i4-0005PK-Ex for submit@debbugs.gnu.org; Thu, 30 May 2013 15:40:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38726) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ui8i1-0005P7-QQ for submit@debbugs.gnu.org; Thu, 30 May 2013 15:40:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui8gO-0004Ve-SM for submit@debbugs.gnu.org; Thu, 30 May 2013 15:38:49 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:39126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui8gO-0004VZ-QK for submit@debbugs.gnu.org; Thu, 30 May 2013 15:38:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui8gK-0004np-69 for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:38:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui8gF-0004T6-3k for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:38:40 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:38626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui8gE-0004Ss-U1 for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:38:35 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ui8gD-00046p-5A for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 21:38:33 +0200 Original-Received: from pd9eb364b.dip0.t-ipconnect.de ([217.235.54.75]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 May 2013 21:38:33 +0200 Original-Received: from Stromeko by pd9eb364b.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 May 2013 21:38:33 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pd9eb364b.dip0.t-ipconnect.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:6L/JWXRVgRlco4mK2X3kGbaxamM= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:74678 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Stefan Monnier writes: > I see the test fails, but that's just because the test is wrong. […] > You'll see that your code behaves differently when byte-compiled. Yes, we've already established that the original code itself had a bug. The correct code would look like this --=-=-= Content-Type: text/x-emacs-lisp Content-Disposition: inline; filename=eme.el (defvar eme-ll nil) (defmacro one (p) `(progn (push ',p eme-ll))) (defmacro two (p) `(let ((pp (append eme-ll ',p))) (progn (push pp eme-ll)))) (provide 'eme) --=-=-= Content-Type: text/plain The remaining point is that the ERT test still fails in exactly the same way when it is _not_ byte-compiled and batch-tested (like the original case in Org), but it produces the correct result when testing in interactive mode or in the debugger. I guess I'm asking for a warning for recursive macro expansions that manipulate the same variable both at expansion and at runtime in separate macros. Alternatively if the buggy code would always fail in the same way that would at least ensure it can be found more easily. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ Wavetables for the Waldorf Blofeld: http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables --=-=-=--