GNU bug report logs - #15786
24.3; No warning on mal-formed let form when lexical-binding

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Sat, 2 Nov 2013 00:39:02 UTC

Severity: normal

Found in version 24.3

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 15786 <at> debbugs.gnu.org (full text, mbox):

From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 15786 <at> debbugs.gnu.org
Subject: Re: bug#15786: 24.3;
 No warning on mal-formed let form when lexical-binding
Date: Sat, 02 Nov 2013 11:26:48 -0400
[Message part 1 (text/plain, inline)]
Nathan Trapuzzano <nbtrap <at> nbtrap.com> writes:

> Patch attached.

Sorry, that patch messed up with (let ((var-with-no-value-form)) ...).

Correct patch attached here.

[cconv.el.patch (text/x-diff, inline)]
From 1cd7356af9caca830f4764205dcbd2f6afe4b6d3 Mon Sep 17 00:00:00 2001
From: Nathan Trapuzzano <nbtrap <at> nbtrap.com>
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


This bug report was last modified 11 years and 201 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.