From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms? Date: Sat, 16 Mar 2024 21:45:19 +0200 Message-ID: <86il1m55bk.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40713"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69832@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 16 20:47:08 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rlZzn-000AIP-CM for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Mar 2024 20:47:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlZzA-0007FB-Dq; Sat, 16 Mar 2024 15:46:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlZz7-0007CC-Fj for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 15:46:25 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rlZz7-00032H-7F for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 15:46:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rlZzi-0002j0-8U for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 15:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Mar 2024 19:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69832 X-GNU-PR-Package: emacs Original-Received: via spool by 69832-submit@debbugs.gnu.org id=B69832.171061839510415 (code B ref 69832); Sat, 16 Mar 2024 19:47:02 +0000 Original-Received: (at 69832) by debbugs.gnu.org; 16 Mar 2024 19:46:35 +0000 Original-Received: from localhost ([127.0.0.1]:56475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlZzH-0002hv-8N for submit@debbugs.gnu.org; Sat, 16 Mar 2024 15:46:35 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlZzA-0002hC-Uf for 69832@debbugs.gnu.org; Sat, 16 Mar 2024 15:46:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlZyU-0002yb-0Q; Sat, 16 Mar 2024 15:45:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1Jhvs86k5s4So7l+AHilToKVoog7eYxOWiobAPr44gA=; b=pDEpirjgXQ4N /63qn/6n3tPTRNYrC4Z64V5AI3Q0gSf/ccAtsrkGjBK4ji4T6FVDTvOgSvU8CosSYGC5Mhc3uc8pQ YcigRLt8QLSJzdRigKKRIeWCknfg1VpeZ65/J8Rnq1lA30j4jN/pNG/FfVyxOetuDq7eOMZrw3Vf2 T0sRWnodL6Chau913t9OLv+iDgsUhb5xFs50eEE1g1c75q2qNkFDxWwkszR2CImF2DW7M59v006aE YBXpG7IfmkHlSKYD1ZlDxYM/64Xaf4yFV9E3v077DdiYjzEfBBve7rt/vGeZqx+TZ48ab5f2rFfIr kba4nswiAjiVS/AEQ/jK0g==; In-Reply-To: (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281735 Archived-At: > 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" > > 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?