Subject: bug#15814: 24.3.50; Signal error on malformed bindings in `cl-symbol-macrolet' (patch)

From: Nathan Trapuzzano <[email-masked]>
Date: Tue, 05 Nov 2013 21:19:06 -0500

Stefan Monnier <[email-masked]> writes:

> Good idea.  Could you try and use macroexp--warn-and-return instead, so
> we get a file&line location when byte-compiling?

I'm not certain what you mean here.  You seem to agree that this is an
error, but `macroexp--warn-and-return' doesn't signal an error--it just
prints a warning.  If we do something like this:

  (let ((msg (format "Malformed `cl-symbol-macrolet' binding: %S"
                     (car bindings))))
    (macroexp--warn-and-return msg `(error "%s" ,msg)))

we'll get a warning at compile time and an error at run time.  Is this
what you have in mind?  Shouldn't we signal the error as early as
possible?  Perhaps there is some Emacs convention that I'm not aware of
in this regard.

> BTW, the same holds for the "let" sanity checks you added to cconv
> (which should probably be moved to macroexp, now that I think about it,
> so we can remove them from bytecomp.el).

I don't understand this either.  By "moved to macroexp", do you just
mean that the sanity checks should be performed using
macroexp--warn-and-return in the manner given above?

Sorry for my confusion.

Nathan