unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Alan Mackenzie <acm@muc.de>
Cc: 53526@debbugs.gnu.org
Subject: bug#53526: 29.0.50; macroexp-warn-and-return API change
Date: Sun, 30 Jan 2022 12:01:46 -0500	[thread overview]
Message-ID: <jwv7dahrwyw.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <YfaTyLb2Cmwz4SXV@ACM> (Alan Mackenzie's message of "Sun, 30 Jan 2022 13:34:00 +0000")

>> No, its name was changed from "macroexp--" to "macroexp-" in Emacs-28,
>> specifically to make available for third party packages.  It was
>> announced in etc/NEWS, for example.
> Are you aware of it being used anywhere else but lisp/emacs-lisp?

Yes and no: there's a use of `macroexp--warn-and-return` in `peg.el`
(in GNU ELPA).  This should be updated to use `macroexp-warn-and-return`
when Emacs-28 is released.

But changing the API this way will discourage its use outside of Emacs
since it's be a pain to write code that deals with such changes (short
of imposing Emacs-29 as the minimum supported version).

>> Still, the current setup is really ugly: that var belongs in
>> `bytecomp.el`.
> Well, I suppose it could be defined in bytecomp.el and just declared in
> macroexp.el.

That's all we need.

> It's not going to get used before it's been initialised in
> bytecomp.el.

If that's the case, it's even better.

>> I'd put a double hyphen there simply because it's not something that we
>> want to expose as an official API.  Just because the bytecompiler's
>> macroexpansion phase is implemented in a separate file doesn't justify
>> making the var public.
> OK, we can mange that.

Thanks.

> I suspect the difficulty in understanding this facility will have
> strongly dissuaded any external hackers from attempting to use it.

Could be.
I suspect it's more a lack of exposure and the fact that most macros are
quick hacks that don't bother to perform much checking.

But it's definitely a facility that's useful for libraries that mostly
define a DSL via macros, like `peg.el` and `bindat.el`.


        Stefan






      reply	other threads:[~2022-01-30 17:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 16:56 bug#53526: 29.0.50; macroexp-warn-and-return API change Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-25 18:16 ` Alan Mackenzie
2022-01-25 19:10   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-01-30 13:34     ` Alan Mackenzie
2022-01-30 17:01       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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=jwv7dahrwyw.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=53526@debbugs.gnu.org \
    --cc=acm@muc.de \
    --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).