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: Eli Zaretskii <eliz@gnu.org>
Cc: 69832@debbugs.gnu.org
Subject: bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms?
Date: Sat, 16 Mar 2024 19:08:56 -0400	[thread overview]
Message-ID: <jwvcyrtg4wu.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86edca53u2.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Mar 2024 22:17:25 +0200")

>> - If we introduce `subr-function-p`, then `subr-primitive-p` is only
>>   "useful" at one place any more, and we can trivially rewrite the code to
>>   avoid it, so we could get rid of it.
> I don't see why we should get rid of subr-primitive-p.

Because there's no point keeping it if all its users could just as well
use `subr-function-p` or `subr-native-elisp-p` instead.

The information provided by the current semantics of `subr-primitive-p`
is "the source code was written in C", and that kind of information is
extremely rarely useful because ELisp code can't really act on that
information.  The only counter example is indeed when that ELisp code is
trying to jump to the source code.

> We can leave it alone, used in that single place where it's useful,
> and let 3rd party packages use it if they want.

It'll mostly lead to 3rd party users either wondering which one they
should use, or picking one arbitrarily without knowing the consequences.
Choice is good when the various alternatives have each their own
strengths and weaknesses, but here it's just extra complexity with no benefit.

If we introduce `subr-function-p` then we should mark `sur-primitive-p`
as obsolete.  And the only thing we gained in the process is churn (it
won't avoid regressions because the rare few users will likely just
blindly replace the old one with the new one).

>> - These functions are used very rarely, the majority is in core files,
>>   and the rest is mostly used to generate human-facing descriptions
>>   so the risk of breakage is low and the kind of breakage is likely to
>>   have a low impact.
> Yes, but I've heard these famous last words one or two times too
> many...

We make backward incompatible changes all the time in Emacs, and the
vast majority of them turns out fine.

I searched for `subr-primitive-p` in Emacs, GNU ELPA, NonGNU ELPA, and
Melpa before making my suggestion.


        Stefan






  reply	other threads:[~2024-03-16 23:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-16 19:30 bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms? Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-16 19:45 ` Eli Zaretskii
2024-03-16 19:58   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-16 20:17     ` Eli Zaretskii
2024-03-16 23:08       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-03-17  6:01         ` Eli Zaretskii
2024-03-17 21:03           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=jwvcyrtg4wu.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69832@debbugs.gnu.org \
    --cc=eliz@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).