unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 69832@debbugs.gnu.org
Subject: bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms?
Date: Sat, 16 Mar 2024 21:45:19 +0200	[thread overview]
Message-ID: <86il1m55bk.fsf@gnu.org> (raw)
In-Reply-To: <jwvv85masau.fsf@iro.umontreal.ca> (bug-gnu-emacs@gnu.org)

> Cc: monnier@iro.umontreal.ca
> Date: Sat, 16 Mar 2024 15:30:01 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> Currently (subr-primitive-p (symbol-function 'if)) returns t.
> Its docstring disagrees:
> 
>     Return t if OBJECT is a built-in primitive function.
> 
> because `if` is indeed a "built-in primitive" but not a "function" (you
> can't `funcall` it and it is rejected by `functionp`: it's a special
> form instead).
> 
> For ELisp's type hierarchy/DAG we need a type for "a built-in primitive
> which is also a function".  Originally, based on the docstring,
> I thought I could use `subr-primitive`.
> But it turns out that the code doesn't quite match the docstring.
> 
> I can see two ways to fix that:
> 
> - Introduce a new type, says `subr-function(-p)` which returns non-nil
>   if and only if the argument is a built-in primitive *and* a function.
> 
> - Change the implementation of `subr-primitive-p` to match its docstring.
> 
> The patch below does the second (including changing the only place
> I found that wants the current semantics.
> 
> Comments?  Objections?

Why take the path of a breaking change instead of the non-breaking
alternative?





  reply	other threads:[~2024-03-16 19:45 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 [this message]
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
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=86il1m55bk.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=69832@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).