From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#14422: 24.3; Eager Macro Expansion Date: Thu, 30 May 2013 15:00:50 -0400 Message-ID: References: <87hahz82rh.fsf@Rainer.invalid> <87mwrcjqlu.fsf@Rainer.invalid> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1369940543 26760 80.91.229.3 (30 May 2013 19:02:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 May 2013 19:02:23 +0000 (UTC) Cc: 14422@debbugs.gnu.org To: Achim Gratz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 30 21:02:22 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 1Ui87C-0006Mt-9k for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 May 2013 21:02:22 +0200 Original-Received: from localhost ([::1]:45030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui87B-0000Q1-Vh for geb-bug-gnu-emacs@m.gmane.org; Thu, 30 May 2013 15:02:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui86S-0007ZM-J0 for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:01:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui86N-0007oB-W7 for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:01:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui86N-0007o6-T0 for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:01:31 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Ui87q-00042e-4R for bug-gnu-emacs@gnu.org; Thu, 30 May 2013 15:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2013 19:03: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: Original-Received: via spool by 14422-submit@debbugs.gnu.org id=B14422.136994055315488 (code B ref 14422); Thu, 30 May 2013 19:03:01 +0000 Original-Received: (at 14422) by debbugs.gnu.org; 30 May 2013 19:02:33 +0000 Original-Received: from localhost ([127.0.0.1]:42775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ui87L-00041h-G0 for submit@debbugs.gnu.org; Thu, 30 May 2013 15:02:32 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:30891) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Ui87I-00041T-Eh for 14422@debbugs.gnu.org; Thu, 30 May 2013 15:02:28 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpYtM/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IPAS-Result: Av4EABK/CFFFpYtM/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDpHqBXoMT X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="15216678" Original-Received: from 69-165-139-76.dsl.teksavvy.com (HELO pastel.home) ([69.165.139.76]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 30 May 2013 15:00:46 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 139B667579; Thu, 30 May 2013 15:00:51 -0400 (EDT) In-Reply-To: <87mwrcjqlu.fsf@Rainer.invalid> (Achim Gratz's message of "Thu, 30 May 2013 19:59:41 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) 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:74670 Archived-At: > Here's the revised test case that compiles cleanly and still has the > same problem: > (defvar eme-ll nil) > (defmacro one (p) > `(progn (push ',p eme-ll))) > (defmacro two (p) > (let (pp) > (setq pp (append eme-ll p)) > `(progn (push ',pp eme-ll)))) > (provide 'eme) > (require 'eme) > (require 'ert) > (ert-deftest surprise () > (should > (equal '((one . two) one) > (progn > (one one) > (two two) > eme-ll)))) I see the test fails, but that's just because the test is wrong. Try to create a new file foo.el: (require 'eme) (message "Result = %s" (progn (one one) (two two) eme-ll)) Then byte-compile it. Then do emacs23 --batch -Q -l ~/tmp/foo.el and emacs23 --batch -Q -l ~/tmp/foo.elc You'll see that your code behaves differently when byte-compiled. Stefan Analysis: (one one) will add `one' to eme-ll at run-time. (two two) reads the macroexpansion-time (e.g. compilation-time, load-time, or run-time) value of eme-ll and adds it to eme-ll at run-time. eme-ll returns the run-time value of eme-ll.