unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nathan Trapuzzano <nbtrap@nbtrap.com>
To: Leo Liu <sdl.web@gmail.com>
Cc: 15786@debbugs.gnu.org
Subject: bug#15786: 24.3; No warning on mal-formed let form when lexical-binding
Date: Sat, 02 Nov 2013 11:26:48 -0400	[thread overview]
Message-ID: <87eh6yn7t3.fsf@nbtrap.com> (raw)
In-Reply-To: <874n7uq4ac.fsf@nbtrap.com> (Nathan Trapuzzano's message of "Sat,  02 Nov 2013 10:14:35 -0400")

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

Nathan Trapuzzano <nbtrap@nbtrap.com> writes:

> Patch attached.

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

Correct patch attached here.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: cconv.el.patch --]
[-- Type: text/x-diff, Size: 1377 bytes --]

From 1cd7356af9caca830f4764205dcbd2f6afe4b6d3 Mon Sep 17 00:00:00 2001
From: Nathan Trapuzzano <nbtrap@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


  parent reply	other threads:[~2013-11-02 15:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-02  0:37 bug#15786: 24.3; No warning on mal-formed let form when lexical-binding Leo Liu
2013-11-02 14:14 ` Nathan Trapuzzano
2013-11-02 14:32   ` Nathan Trapuzzano
2013-11-02 15:26   ` Nathan Trapuzzano [this message]
2013-11-04 19:48     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eh6yn7t3.fsf@nbtrap.com \
    --to=nbtrap@nbtrap.com \
    --cc=15786@debbugs.gnu.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).