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

From: Nathan Trapuzzano <[email-masked]>
Date: Wed, 06 Nov 2013 06:16:55 -0500

Stefan Monnier <[email-masked]> writes:

>>   (let ((msg (format "Malformed `cl-symbol-macrolet' binding: %S"
>>                      (car bindings))))
>>     (macroexp--warn-and-return msg `(error "%s" ,msg)))
>
> Signaling an error stops the whole compilation, so you only get one
> error at a time.  Better make it a warning, even though it is indeed
> a programming error.

And then signal the error at run time?  Do I understand you correctly
about that?

What if we're not compiling?  If you don't want the error to abort the
build process, it seems that the ideal solution would be, in the compiled
case, to print a warning during compilation and signal an error at run
time; and in the interpreted case, to signal the error at macro
expansion time.

> No, I mean that they should be performed in macroexp--expand-all rather
> than in cconv, so they're performed regardless of lexical-binding
> (currently they're done once in cconv.el and once in bytecomp.el).

This wouldn't work since there's no guarantee that any particular form
passes through macroexp--expand-all, not in the interpreter at least.