unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Nathan Trapuzzano <nbtrap@nbtrap.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15814@debbugs.gnu.org
Subject: bug#15814: 24.3.50; Signal error on malformed bindings in `cl-symbol-macrolet' (patch)
Date: Wed, 06 Nov 2013 20:14:37 -0500	[thread overview]
Message-ID: <871u2tgghu.fsf@nbtrap.com> (raw)
In-Reply-To: <jwvy551abr5.fsf-monnier+emacsbugs@gnu.org> (Stefan Monnier's message of "Wed, 06 Nov 2013 08:45:24 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>>> (let ((msg (format "Malformed `cl-symbol-macrolet' binding: %S"
>>>> (car bindings))))
>>>> (macroexp--warn-and-return msg `(error "%s" ,msg)))
>
> Check other uses of macroexp--warn-and-return (there aren't many).
> It doesn't signal any error at all.  But they do emit warnings either
> during compilation or while loading an interpreted file.

In the example I gave, the second argument to macroexp--warn-and-return
is an (error ...) form, which will be evaluated at run time.  That's
what I meant.  If we're going to use macroexp--warn-and-return, it seems
this is the only sensible thing to do (in this case that is).  What's
the alternative?  Transform malformed let in some undefined way?  At the
very least, the behavior when compiled/evaluated should be the same as
when interpreted, i.e. an error.

But more generally, what's wrong with signalling the error at compile
time?  Sure, it would cause the Emacs build to fail, but I would call
that an advantage.  Not to mention, it's especially easy to miss the
warnings during the build process, as opposed to compiling individual
files manually.

> As I said, currently it's performed in bytecomp.el and cconv.el, and
> there's no way to get to either of those two without going through
> macroexp--expand-all first.  So, yes, there is a guarantee.
>
> When loading an interpreted file, we go through macroexp--expand-all as
> well (not not through cconv.el nor through bytecomp.el).

It doesn't look like evaluation via M-: has to go through
macroexp--expand-all.  Try:

M-:
(let ((foo 'bar)) foo)
RET

Though I guess in the specific case of malformed `let', this doesn't
really matter, since the interpreter will catch the error.





  reply	other threads:[~2013-11-07  1:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05 20:40 bug#15814: 24.3.50; Signal error on malformed bindings in `cl-symbol-macrolet' (patch) Nathan Trapuzzano
2013-11-06  0:46 ` Stefan Monnier
2013-11-06  2:19   ` Nathan Trapuzzano
2013-11-06  3:20     ` Stefan Monnier
2013-11-06 11:16       ` Nathan Trapuzzano
2013-11-06 13:45         ` Stefan Monnier
2013-11-07  1:14           ` Nathan Trapuzzano [this message]
2013-11-07  2:08             ` Stefan Monnier
2013-11-07  3:22               ` Nathan Trapuzzano
2013-11-07  4:38                 ` Stefan Monnier
2013-11-07 19:51                   ` Nathan Trapuzzano
2013-11-08  1:21                     ` Stefan Monnier
2013-11-08  1:29                       ` Nathan Trapuzzano
2013-11-08  3:02                         ` Stefan Monnier
2013-11-08 11:40                           ` Nathan Trapuzzano
2013-11-08 13:33                             ` Stefan Monnier
2013-11-08 14:39                               ` Nathan Trapuzzano
2013-11-08 19:06                                 ` Stefan Monnier
2013-11-09  2:06                                   ` Nathan Trapuzzano
2013-11-09  8:36                                     ` Andreas Schwab
2013-11-09 12:00                                       ` Nathan Trapuzzano
2013-11-11  4:55                                         ` Stefan Monnier
2013-11-07  7:08 ` bug#15814: bootstrap fails due to recent cl-symbol-macrolet patch Paul Eggert
2013-11-07 12:58   ` Nathan Trapuzzano
2013-11-07 19:46     ` Stefan Monnier
2013-11-07 21:03       ` Glenn Morris
2013-11-07 22:07         ` Glenn Morris
2013-11-08  1:34           ` 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=871u2tgghu.fsf@nbtrap.com \
    --to=nbtrap@nbtrap.com \
    --cc=15814@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).