From unknown Fri Jun 20 20:13:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15786: 24.3; No warning on mal-formed let form when lexical-binding Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Nov 2013 00:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15786 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 15786@debbugs.gnu.org Cc: Stefan Monnier X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Stefan Monnier Received: via spool by submit@debbugs.gnu.org id=B.13833527065830 (code B ref -1); Sat, 02 Nov 2013 00:39:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Nov 2013 00:38:26 +0000 Received: from localhost ([127.0.0.1]:58346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VcPEQ-0001Vx-Ex for submit@debbugs.gnu.org; Fri, 01 Nov 2013 20:38:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53968) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VcPEM-0001Vh-R6 for submit@debbugs.gnu.org; Fri, 01 Nov 2013 20:38:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcPEC-0005HZ-BJ for submit@debbugs.gnu.org; Fri, 01 Nov 2013 20:38:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcPEC-0005HV-8P for submit@debbugs.gnu.org; Fri, 01 Nov 2013 20:38:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcPE6-0001Mz-T0 for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 20:38:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcPDz-0005FY-W6 for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 20:38:06 -0400 Received: from mail-pb0-x236.google.com ([2607:f8b0:400e:c01::236]:55151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcPDz-0005FT-No for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 20:37:59 -0400 Received: by mail-pb0-f54.google.com with SMTP id ro8so4992774pbb.27 for ; Fri, 01 Nov 2013 17:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=4Ak/6/CKcA+QWLQQ+Z3/cbMG5/jFIKI4hpl6nNPW4lU=; b=inA1fqLUGgpOXOkYjmqIcqTjKyMTCvbG92P/GVg5Kb85wR7XYesQGEZFuBl0Opa3N5 4rh2MvrUYbS/RMz7LPuL+bhsmlGHMLjLCgOEfWefXag7exYwo8x+ITzEYlLmzCp/TXpy cEXGGAKsZu5OfNSNdYbL299TAUWdxBkZBwEYg2EEuFvP6LoBI0JqFiEHFio5Uv0oZklj I8MAg1sDtQOHGKxQUj9bvYLOYPmvpQwYTHre6dowwGhirQ10pgppLkqpBzT7SOVtD/2E E8sFkUTSodsE0fc8HKVJcZkkiDCIFmIScReRDG6r6G8J4znN4wVL3M+bW2BqMOYakeBd fu7w== X-Received: by 10.66.100.227 with SMTP id fb3mr5846730pab.26.1383352678662; Fri, 01 Nov 2013 17:37:58 -0700 (PDT) Received: from localhost ([123.119.81.79]) by mx.google.com with ESMTPSA id fk4sm15989134pab.23.2013.11.01.17.37.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Nov 2013 17:37:57 -0700 (PDT) From: Leo Liu Date: Sat, 02 Nov 2013 08:37:52 +0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain Due to a typo in my code, I got a bug report on ggtags https://github.com/leoliu/ggtags/issues/17. I was fooled by the elisp compiler which warns mal-formed let forms without lexical-binding. To reproduce 1. Download the file in the attachment 2. byte-compile it 3. remove the first line and byte-compile it step 2 produces no warnings while step 3 does. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=t.el Content-Transfer-Encoding: quoted-printable ;; -*- lexical-binding: t; -*- (defmacro ggtags-with-ctags-maybe (&rest body) `(let ((process-environment (if (sin 12) (cons "GTAGSLABEL=3Dctags" process-environment)) process-environment)) ,@body)) (defun test () (interactive) (ggtags-with-ctags-maybe t)) --=-=-=-- From unknown Fri Jun 20 20:13:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15786: 24.3; No warning on mal-formed let form when lexical-binding Resent-From: Nathan Trapuzzano Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Nov 2013 14:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15786 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Leo Liu Cc: 15786@debbugs.gnu.org Received: via spool by 15786-submit@debbugs.gnu.org id=B15786.138340168632155 (code B ref 15786); Sat, 02 Nov 2013 14:15:02 +0000 Received: (at 15786) by debbugs.gnu.org; 2 Nov 2013 14:14:46 +0000 Received: from localhost ([127.0.0.1]:59546 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VcbyP-0008MZ-V5 for submit@debbugs.gnu.org; Sat, 02 Nov 2013 10:14:46 -0400 Received: from oproxy7-pub.mail.unifiedlayer.com ([67.222.55.9]:60454) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1VcbyL-0008MO-44 for 15786@debbugs.gnu.org; Sat, 02 Nov 2013 10:14:45 -0400 Received: (qmail 31995 invoked by uid 0); 2 Nov 2013 14:14:37 -0000 Received: from unknown (HELO host393.hostmonster.com) (66.147.240.193) by oproxy7.mail.unifiedlayer.com with SMTP; 2 Nov 2013 14:14:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbtrap.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=IhWkMvek+EdhJ9N0sOgkvMT5OCyLdnypf3NkdTLXGtM=; b=O4h+Wd6lH7ZbkBXytxGTDYcGUWMvF9JE8R+ObAx2/W+lyZacl3RMLQUNNAghtALjAhnpge58FE+xz8PUAMiwkMJaYgVfZLETvEW397zXt1HV9qW66WsC7Zlc5Op9f9CN; Received: from [50.90.253.209] (port=45201 helo=Nathan-GNU) by host393.hostmonster.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1VcbyH-00023V-4h; Sat, 02 Nov 2013 08:14:37 -0600 From: Nathan Trapuzzano References: Date: Sat, 02 Nov 2013 10:14:35 -0400 In-Reply-To: (Leo Liu's message of "Sat, 02 Nov 2013 08:37:52 +0800") Message-ID: <874n7uq4ac.fsf@nbtrap.com> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Identified-User: {1585:host393.hostmonster.com:nbtrapco:nbtrap.com} {sentby:smtp auth 50.90.253.209 authed with nbtrap@nbtrap.com} X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Leo Liu writes: > Due to a typo in my code, I got a bug report on ggtags > https://github.com/leoliu/ggtags/issues/17. I was fooled by the elisp > compiler which warns mal-formed let forms without lexical-binding. > > To reproduce > 1. Download the file in the attachment > 2. byte-compile it > 3. remove the first line and byte-compile it > > step 2 produces no warnings while step 3 does. Under lexical binding, the malformed `let' is correctly reformed in `cconv-convert' before it gets passed to the optimizer. In other words, it's assumed to be properly formed. This looks like a bug. On first thought, it seems that cconv-convert should check for proper form and signal an _error_ if the check fails. On the other hand, this would be inconsistent with what happens under dynamic binding. (On that note, under dynamic binding, why is this considered a warning and not an error?) Patch attached. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=cconv.el.patch >From 1cce762e1586ce9faa7fc41712973e22c1ea723c Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 2 Nov 2013 10:12:35 -0400 Subject: [PATCH] Assert proper form of let binding during byte compilation under lexical binding. --- lisp/emacs-lisp/cconv.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index f24e503..6d87521 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -289,12 +289,14 @@ places where they originally did not directly appear." (dolist (binder binders) (let* ((value nil) - (var (if (not (consp binder)) - (prog1 binder (setq binder (list binder))) - (setq value (cadr binder)) - (car binder))) - (new-val - (cond + (var (if (not (consp binder)) + (prog1 binder (setq binder (list binder))) + (cl-assert (= (length (cdr binder)) 1) nil + "malformed let binding: `%s'" (prin1-to-string binder)) + (setq value (cadr binder)) + (car binder))) + (new-val + (cond ;; Check if var is a candidate for lambda lifting. ((and (member (cons binder form) cconv-lambda-candidates) (progn -- 1.8.4.2 --=-=-=-- From unknown Fri Jun 20 20:13:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15786: 24.3; No warning on mal-formed let form when lexical-binding Resent-From: Nathan Trapuzzano Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Nov 2013 14:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15786 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Leo Liu Cc: 15786@debbugs.gnu.org Received: via spool by 15786-submit@debbugs.gnu.org id=B15786.13834027711376 (code B ref 15786); Sat, 02 Nov 2013 14:33:01 +0000 Received: (at 15786) by debbugs.gnu.org; 2 Nov 2013 14:32:51 +0000 Received: from localhost ([127.0.0.1]:59559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VccFv-0000M7-76 for submit@debbugs.gnu.org; Sat, 02 Nov 2013 10:32:51 -0400 Received: from outbound-ss-60.hostmonster.com ([66.147.255.13]:48604) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1VccFs-0000Lw-8g for 15786@debbugs.gnu.org; Sat, 02 Nov 2013 10:32:49 -0400 Received: (qmail 8719 invoked by uid 0); 2 Nov 2013 14:32:45 -0000 Received: from unknown (HELO host393.hostmonster.com) (66.147.240.193) by oproxy17-pub.mail.unifiedlayer.com with SMTP; 2 Nov 2013 14:32:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbtrap.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=xVk1P51cRElQydD8yLRuUMM4x099978Xpc9JBYTQFIQ=; b=qn2jptBpW6Envn3kAuQZqDJ6+kcZeEJZSUiHx5LhMFKfzvCLuNujZyKqsfGK24ygH3A/+rvBZHVLy/uhR1I0ax/HjP0Uo9kCZN2xSiGzk1FKRGF10iHKwktZLBQZNGLK; Received: from [50.90.253.209] (port=45222 helo=Nathan-GNU) by host393.hostmonster.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1VccFp-0004Xe-4Q; Sat, 02 Nov 2013 08:32:45 -0600 From: Nathan Trapuzzano References: <874n7uq4ac.fsf@nbtrap.com> Date: Sat, 02 Nov 2013 10:32:43 -0400 In-Reply-To: <874n7uq4ac.fsf@nbtrap.com> (Nathan Trapuzzano's message of "Sat, 02 Nov 2013 10:14:35 -0400") Message-ID: <87habuoovo.fsf@nbtrap.com> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Identified-User: {1585:host393.hostmonster.com:nbtrapco:nbtrap.com} {sentby:smtp auth 50.90.253.209 authed with nbtrap@nbtrap.com} X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Nathan Trapuzzano writes: > (On that note, under dynamic binding, why is this considered a warning > and not an error?) By the way, this is an error when interpreted. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Nathan Trapuzzano writes: > (On that note, under dynamic binding, why is this considered a warning > and not an error?) By the way, this is an error when interpreted. [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid Nathan Trapuzzano writes: > (On that note, under dynamic binding, why is this considered a warning > and not an error?) By the way, this is an error when interpreted. From unknown Fri Jun 20 20:13:00 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15786: 24.3; No warning on mal-formed let form when lexical-binding Resent-From: Nathan Trapuzzano Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 02 Nov 2013 15:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15786 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Leo Liu Cc: 15786@debbugs.gnu.org Received: via spool by 15786-submit@debbugs.gnu.org id=B15786.13834060217339 (code B ref 15786); Sat, 02 Nov 2013 15:28:02 +0000 Received: (at 15786) by debbugs.gnu.org; 2 Nov 2013 15:27:01 +0000 Received: from localhost ([127.0.0.1]:59627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vcd6K-0001u0-Uw for submit@debbugs.gnu.org; Sat, 02 Nov 2013 11:27:01 -0400 Received: from outbound-ss-2175.bluehost.com ([74.220.218.8]:42534) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1Vcd6H-0001tm-0l for 15786@debbugs.gnu.org; Sat, 02 Nov 2013 11:26:58 -0400 Received: (qmail 1852 invoked by uid 0); 2 Nov 2013 15:26:52 -0000 Received: from unknown (HELO host393.hostmonster.com) (66.147.240.193) by oproxy16-pub.mail.unifiedlayer.com with SMTP; 2 Nov 2013 15:26:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbtrap.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=Ng/VzEL5/081wGxxjiM6zuVQfizarMXeWKBH5pAPw4g=; b=Q1SNlbLGXWnGJXByrcAUfBokrkKLLMWBv2bmqAWE21P++Bz/bvZcyGEyROYAYH2JAllY+BA4NcRfA9fC5kuZ33rI6pNw/wyB+GkTvHemi2ofkqmBhV2Yq5v/I1WB7VJB; Received: from [50.90.253.209] (port=45467 helo=Nathan-GNU) by host393.hostmonster.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1Vcd6B-0003HC-Uj; Sat, 02 Nov 2013 09:26:52 -0600 From: Nathan Trapuzzano References: <874n7uq4ac.fsf@nbtrap.com> Date: Sat, 02 Nov 2013 11:26:48 -0400 In-Reply-To: <874n7uq4ac.fsf@nbtrap.com> (Nathan Trapuzzano's message of "Sat, 02 Nov 2013 10:14:35 -0400") Message-ID: <87eh6yn7t3.fsf@nbtrap.com> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Identified-User: {1585:host393.hostmonster.com:nbtrapco:nbtrap.com} {sentby:smtp auth 50.90.253.209 authed with nbtrap@nbtrap.com} X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Nathan Trapuzzano writes: > Patch attached. Sorry, that patch messed up with (let ((var-with-no-value-form)) ...). [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.220.218.8 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Nathan Trapuzzano writes: > Patch attached. Sorry, that patch messed up with (let ((var-with-no-value-form)) ...). [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [74.220.218.8 listed in list.dnswl.org] 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid --=-=-= Content-Type: text/plain Nathan Trapuzzano writes: > Patch attached. Sorry, that patch messed up with (let ((var-with-no-value-form)) ...). Correct patch attached here. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=cconv.el.patch >From 1cd7356af9caca830f4764205dcbd2f6afe4b6d3 Mon Sep 17 00:00:00 2001 From: Nathan Trapuzzano Date: Sat, 2 Nov 2013 10:12:35 -0400 Subject: [PATCH] Assert proper form of let binding during byte compilation under lexical binding. --- lisp/emacs-lisp/cconv.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el index f24e503..3fc2fc4 100644 --- a/lisp/emacs-lisp/cconv.el +++ b/lisp/emacs-lisp/cconv.el @@ -289,12 +289,14 @@ places where they originally did not directly appear." (dolist (binder binders) (let* ((value nil) - (var (if (not (consp binder)) - (prog1 binder (setq binder (list binder))) - (setq value (cadr binder)) - (car binder))) - (new-val - (cond + (var (if (not (consp binder)) + (prog1 binder (setq binder (list binder))) + (cl-assert (null (cdr (cdr binder))) nil + "malformed let binding: `%s'" (prin1-to-string binder)) + (setq value (cadr binder)) + (car binder))) + (new-val + (cond ;; Check if var is a candidate for lambda lifting. ((and (member (cons binder form) cconv-lambda-candidates) (progn -- 1.8.4.2 --=-=-=-- From unknown Fri Jun 20 20:13:00 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Leo Liu Subject: bug#15786: closed (Re: bug#15786: 24.3; No warning on mal-formed let form when lexical-binding) Message-ID: References: X-Gnu-PR-Message: they-closed 15786 X-Gnu-PR-Package: emacs Reply-To: 15786@debbugs.gnu.org Date: Mon, 04 Nov 2013 19:50:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1383594603-16474-1" This is a multi-part message in MIME format... ------------=_1383594603-16474-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #15786: 24.3; No warning on mal-formed let form when lexical-binding which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 15786@debbugs.gnu.org. --=20 15786: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D15786 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1383594603-16474-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 15786-done) by debbugs.gnu.org; 4 Nov 2013 19:49:05 +0000 Received: from localhost ([127.0.0.1]:34600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VdQ92-0004GQ-J6 for submit@debbugs.gnu.org; Mon, 04 Nov 2013 14:49:04 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:51618) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VdQ8z-0004Fv-70 for 15786-done@debbugs.gnu.org; Mon, 04 Nov 2013 14:49:01 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFxLzd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDiGGcGYFegxU X-IPAS-Result: Av4EABK/CFFFxLzd/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYSFBgNJIgeBsEtkQoDiGGcGYFegxU X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="37071490" Received: from 69-196-188-221.dsl.teksavvy.com (HELO pastel.home) ([69.196.188.221]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Nov 2013 14:48:53 -0500 Received: by pastel.home (Postfix, from userid 20848) id 4907B60D75; Mon, 4 Nov 2013 14:48:50 -0500 (EST) From: Stefan Monnier To: Nathan Trapuzzano Subject: Re: bug#15786: 24.3; No warning on mal-formed let form when lexical-binding Message-ID: References: <874n7uq4ac.fsf@nbtrap.com> <87eh6yn7t3.fsf@nbtrap.com> Date: Mon, 04 Nov 2013 14:48:50 -0500 In-Reply-To: <87eh6yn7t3.fsf@nbtrap.com> (Nathan Trapuzzano's message of "Sat, 02 Nov 2013 11:26:48 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 15786-done Cc: 15786-done@debbugs.gnu.org, Leo Liu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Correct patch attached here. Thanks, installed, Stefan ------------=_1383594603-16474-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 Nov 2013 00:38:26 +0000 Received: from localhost ([127.0.0.1]:58346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VcPEQ-0001Vx-Ex for submit@debbugs.gnu.org; Fri, 01 Nov 2013 20:38:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53968) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VcPEM-0001Vh-R6 for submit@debbugs.gnu.org; Fri, 01 Nov 2013 20:38:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcPEC-0005HZ-BJ for submit@debbugs.gnu.org; Fri, 01 Nov 2013 20:38:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:48734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcPEC-0005HV-8P for submit@debbugs.gnu.org; Fri, 01 Nov 2013 20:38:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55672) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcPE6-0001Mz-T0 for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 20:38:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VcPDz-0005FY-W6 for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 20:38:06 -0400 Received: from mail-pb0-x236.google.com ([2607:f8b0:400e:c01::236]:55151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VcPDz-0005FT-No for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 20:37:59 -0400 Received: by mail-pb0-f54.google.com with SMTP id ro8so4992774pbb.27 for ; Fri, 01 Nov 2013 17:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=4Ak/6/CKcA+QWLQQ+Z3/cbMG5/jFIKI4hpl6nNPW4lU=; b=inA1fqLUGgpOXOkYjmqIcqTjKyMTCvbG92P/GVg5Kb85wR7XYesQGEZFuBl0Opa3N5 4rh2MvrUYbS/RMz7LPuL+bhsmlGHMLjLCgOEfWefXag7exYwo8x+ITzEYlLmzCp/TXpy cEXGGAKsZu5OfNSNdYbL299TAUWdxBkZBwEYg2EEuFvP6LoBI0JqFiEHFio5Uv0oZklj I8MAg1sDtQOHGKxQUj9bvYLOYPmvpQwYTHre6dowwGhirQ10pgppLkqpBzT7SOVtD/2E E8sFkUTSodsE0fc8HKVJcZkkiDCIFmIScReRDG6r6G8J4znN4wVL3M+bW2BqMOYakeBd fu7w== X-Received: by 10.66.100.227 with SMTP id fb3mr5846730pab.26.1383352678662; Fri, 01 Nov 2013 17:37:58 -0700 (PDT) Received: from localhost ([123.119.81.79]) by mx.google.com with ESMTPSA id fk4sm15989134pab.23.2013.11.01.17.37.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Nov 2013 17:37:57 -0700 (PDT) From: Leo Liu To: bug-gnu-emacs@gnu.org Subject: 24.3; No warning on mal-formed let form when lexical-binding X-Debbugs-CC: Stefan Monnier Date: Sat, 02 Nov 2013 08:37:52 +0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --=-=-= Content-Type: text/plain Due to a typo in my code, I got a bug report on ggtags https://github.com/leoliu/ggtags/issues/17. I was fooled by the elisp compiler which warns mal-formed let forms without lexical-binding. To reproduce 1. Download the file in the attachment 2. byte-compile it 3. remove the first line and byte-compile it step 2 produces no warnings while step 3 does. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=t.el Content-Transfer-Encoding: quoted-printable ;; -*- lexical-binding: t; -*- (defmacro ggtags-with-ctags-maybe (&rest body) `(let ((process-environment (if (sin 12) (cons "GTAGSLABEL=3Dctags" process-environment)) process-environment)) ,@body)) (defun test () (interactive) (ggtags-with-ctags-maybe t)) --=-=-=-- ------------=_1383594603-16474-1--