From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.bugs Subject: bug#13813: 24.3.50; eval-and-compile in macro inhibits let-binding of variable Date: Mon, 25 Feb 2013 22:17:53 +0100 Message-ID: <874nh05bzy.fsf@engster.org> References: <87d2vo5nzy.fsf@engster.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361827105 26960 80.91.229.3 (25 Feb 2013 21:18:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Feb 2013 21:18:25 +0000 (UTC) Cc: 13813@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 25 22:18:48 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 1UA5Re-0007pQ-TH for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Feb 2013 22:18:47 +0100 Original-Received: from localhost ([::1]:59118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA5RK-0004jm-4K for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Feb 2013 16:18:26 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA5RH-0004ja-3P for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 16:18:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA5RF-0006OB-UQ for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 16:18:23 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA5RF-0006O6-OK for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 16:18:21 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UA5Ss-0003p7-Ct for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 16:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: David Engster Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Feb 2013 21:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13813 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13813-submit@debbugs.gnu.org id=B13813.136182718114665 (code B ref 13813); Mon, 25 Feb 2013 21:20:02 +0000 Original-Received: (at 13813) by debbugs.gnu.org; 25 Feb 2013 21:19:41 +0000 Original-Received: from localhost ([127.0.0.1]:50090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA5SW-0003oS-2T for submit@debbugs.gnu.org; Mon, 25 Feb 2013 16:19:41 -0500 Original-Received: from randomsample.de ([83.169.19.17]:49339) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA5SS-0003oK-VW for 13813@debbugs.gnu.org; Mon, 25 Feb 2013 16:19:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=2Ars+O0s5KdxMqPdme2RDtOBVpeDyfGCJpB+Lw43OMI=; b=OWDMhAMFlLRfHWMcA2bMLbsC4UbQsMzshCZOrGfkgZzWQNrAGreOxFYkrqxjrgbOK3wGKFhE6lSLn3dg/xMdGPF68qchkBO2300CZl+lH5BjU/XsjII6HYq3fkOE6Hus; Original-Received: from dslc-082-082-165-164.pools.arcor-ip.net ([82.82.165.164] helo=spaten) by randomsample.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1UA5Qn-0002XR-P2; Mon, 25 Feb 2013 22:17:53 +0100 In-Reply-To: (Stefan Monnier's message of "Mon, 25 Feb 2013 15:53:21 -0500") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.93 (gnu/linux) Mail-Copies-To: never 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:71802 Archived-At: Stefan Monnier writes: > OK, you got me, I admit it, Ha! No one can escape the EIEIO testsuite! > I changed recently eval-and-compile to be (in effect) > eval-during-load-and-compile. I could turn it into a > eval-during-eval-load-and-compile, but then your above test would run > `mytestfun' twice (once with myflag=nil and then once with myflag=t) > which I don't think would please everyone either. Yep, my gut says that would create problems in EIEIO, too. >> * Note the following: >> - It works if you just 'setq' the 'myflag' variable > > But not if you (progn (setq myflag t) (mytestmacro)). True. I didn't test that. >> And yes, Stefan, this bug turned up in the EIEIO test suite. :-) > > Could you give some details, so we can better assess the best solution? There is a flag called `eieio-error-unsupported-class-tags' which makes `eieio-defclass' signal an error if a tag is unsupported. Since `eieio-defclass' is the implementation of the `defclass' macro (wrapped in `eval-and-comopile'), this flag has no effect if it is set in a let-binding. To be specific, the test checks that this (let ((eieio-error-unsupported-class-tags t)) (defclass class-error () ((error-slot :initarg :error-slot :badslottag 1)) "A class with a bad slot tag.")) is throwing an error. > BTW, I think eval-and-compile should only be used to wrap definitions. > Anything else is asking for trouble. As I said: I can't wrap my head around that stuff. But the Emacs Lisp manual specifically mentions this use case for `eval-and-compile'. Out of curiosity I removed the `eval-and-compile' and everything seems to work fine, which just adds to my confusion. -David