From unknown Tue Jun 17 20:10:54 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#69832 <69832@debbugs.gnu.org> To: bug#69832 <69832@debbugs.gnu.org> Subject: Status: 30.0.50; Should `subr-primitive-p` apply to special-forms? Reply-To: bug#69832 <69832@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:10:54 +0000 retitle 69832 30.0.50; Should `subr-primitive-p` apply to special-forms? reassign 69832 emacs submitter 69832 Stefan Monnier severity 69832 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 16 15:31:06 2024 Received: (at submit) by debbugs.gnu.org; 16 Mar 2024 19:31:06 +0000 Received: from localhost ([127.0.0.1]:56461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlZkI-0002Ii-20 for submit@debbugs.gnu.org; Sat, 16 Mar 2024 15:31:06 -0400 Received: from lists.gnu.org ([209.51.188.17]:42008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlZkG-0002Ia-21 for submit@debbugs.gnu.org; Sat, 16 Mar 2024 15:31:05 -0400 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 1rlZje-000369-AA for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 15:30:26 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlZjb-0008VD-Kn for bug-gnu-emacs@gnu.org; Sat, 16 Mar 2024 15:30:26 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 97BE71000DD for ; Sat, 16 Mar 2024 15:30:21 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1710617416; bh=dLO2Fi6iG90vMhg5XkV+E427X88WYhSeGAavS+9zszY=; h=From:To:Subject:Date:From; b=nECiu10xO3iRgpgVlrFIyq6Q0P0kE2F0a8QGkMQepnh+S2hnyuoy8zdv9edqlA1vc +bxp4bmKHvuONI5tr7wCp8aJJtdNwAIOcmGdf6zcIBCD4GfJDPg45MmwtNyMsPyPVN 0fT6bJIvsIuOzXckQvO+gcYAfaCAmanZE9l6/94weKAJo9dQpbuKUAPxurcWRSfcpK Khn98IAXLYP/6BezxQpxmqaafEcuPeTAjBRLUKlHrAKAYZwY2N1P0TQECuw2rsLddS cDFX031hMiMGAXq6Yq8UUhL7p+sHbZoef2pt7PGCbCAcawtjReEJHIDUUoHSFdwIIz sOjjIzlnp9mZQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 12321100048 for ; Sat, 16 Mar 2024 15:30:16 -0400 (EDT) Received: from pastel (unknown [104.247.232.89]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EEDCE12044C for ; Sat, 16 Mar 2024 15:30:15 -0400 (EDT) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: 30.0.50; Should `subr-primitive-p` apply to special-forms? X-Debbugs-Cc: monnier@iro.umontreal.ca Date: Sat, 16 Mar 2024 15:30:01 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.315 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Package: Emacs Version: 30.0.50 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? Stefan diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 411602ef166..3458ace1c08 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -552,7 +552,7 @@ find-function-library (cons function (cond ((autoloadp def) (nth 1 def)) - ((subr-primitive-p def) + ((or (subr-primitive-p def) (special-form-p def)) (if lisp-only (error "%s is a built-in function" function)) (help-C-file-name def 'subr)) diff --git a/lisp/subr.el b/lisp/subr.el index 38a3f6edb34..f403369f534 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -315,7 +315,8 @@ subr-primitive-p "Return t if OBJECT is a built-in primitive function." (declare (side-effect-free error-free)) (and (subrp object) - (not (subr-native-elisp-p object)))) + (not (or (subr-native-elisp-p object) + (special-form-p object))))) (defsubst xor (cond1 cond2) "Return the boolean exclusive-or of COND1 and COND2. From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 16 15:46:35 2024 Received: (at 69832) by debbugs.gnu.org; 16 Mar 2024 19:46:35 +0000 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 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 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==; Date: Sat, 16 Mar 2024 21:45:19 +0200 Message-Id: <86il1m55bk.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms? References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69832 Cc: 69832@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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? From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 16 15:59:02 2024 Received: (at 69832) by debbugs.gnu.org; 16 Mar 2024 19:59:02 +0000 Received: from localhost ([127.0.0.1]:56487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlaBK-00038u-0Z for submit@debbugs.gnu.org; Sat, 16 Mar 2024 15:59:02 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:33277) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlaBH-00038X-TE for 69832@debbugs.gnu.org; Sat, 16 Mar 2024 15:59:00 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id BEE361000DD; Sat, 16 Mar 2024 15:58:16 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1710619091; bh=skY08CUkPSq4dVlUnEcig40pOMGE0C6bLSk6fXDqfFE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=l6IRsdfq/VqR5dFbGXqEpRZMmTT8sP8CSeZM6siyXGqUEZ0IRJcBJcYaLIZoLSRoU FnttP1NaKXgjtUvhWmCGCKfS/MT4yRvEdD6AfKBcv840x1tuH6suvnnJvk6ZMVPv7J z1wZg1pG64AKLK+xHQbJp2DdcJ9rARjC0sHWZChHNlV1qQ8V4zV3hWEsMsIVOUSTbk XhzcJ0vp6MXf4QHFC1EqNZ/Q7NxZyZYDP51dMjcHeks6K/yQniQw3oC6IcpHP0g8lE RDo9yBvIXYsWr8TtrbjU6X9U8CSZaMzwON6WkLCkGgy0uwGyR51kWp/VUfVJFegODP gwV0s5o1sq95g== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5057B100048; Sat, 16 Mar 2024 15:58:11 -0400 (EDT) Received: from pastel (unknown [104.247.238.200]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 2D58D120495; Sat, 16 Mar 2024 15:58:11 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms? In-Reply-To: <86il1m55bk.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Mar 2024 21:45:19 +0200") Message-ID: References: <86il1m55bk.fsf@gnu.org> Date: Sat, 16 Mar 2024 15:58:09 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.294 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69832 Cc: 69832@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> 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? - It can be considered as a bug fix (to make the code match its doc). - 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. - 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. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 16 16:18:48 2024 Received: (at 69832) by debbugs.gnu.org; 16 Mar 2024 20:18:48 +0000 Received: from localhost ([127.0.0.1]:56549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlaUS-0006WA-4z for submit@debbugs.gnu.org; Sat, 16 Mar 2024 16:18:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlaUQ-0006Vt-5y for 69832@debbugs.gnu.org; Sat, 16 Mar 2024 16:18:46 -0400 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 1rlaTj-0007dE-4L; Sat, 16 Mar 2024 16:18:03 -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=KvHaNEf3FC+oDfNepL2SdRjagX4YYeAxCOSLdDi2EVs=; b=ck5zFy9cf8hK Aeq3p0zoIAbAOsiH5YHgywoKoHG/1onk6i/fIa0JM08MlUDCyhxjzuLUksMaeAEYq/EVDn0HN6Wns rCFt1Agp+vOatIgKbwPVlzqMpZJMMv+z9jK5iI/nqmHOmHMd10U76QFHT+eqyBv6ZUKxJ/dxBXpR1 pOjZ0PXi4ekQpjqcEwi0oXj+TULrJuUFZNIke13/M02xcmbjU5A+GuUAIDEc8G/I7MVJ2aC9ptH7d yEupffNwsZrepdlh686rmvQJnVPgojnTdWVxThDcVxBpD0eT+LBMYJO/U9Bo0Dkk6tqzZmLl7sLkh xAsGmtdt4BIeXPF/tvNHiA==; Date: Sat, 16 Mar 2024 22:17:25 +0200 Message-Id: <86edca53u2.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sat, 16 Mar 2024 15:58:09 -0400) Subject: Re: bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms? References: <86il1m55bk.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69832 Cc: 69832@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: 69832@debbugs.gnu.org > Date: Sat, 16 Mar 2024 15:58:09 -0400 > > > Why take the path of a breaking change instead of the non-breaking > > alternative? > > - It can be considered as a bug fix (to make the code match its doc). Or we could fix its doc string to be more accurate, and match what the code does. > - 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. We can leave it alone, used in that single place where it's useful, and let 3rd party packages use it if they want. And we can then use the new function where that is needed. > - 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... From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 16 19:09:49 2024 Received: (at 69832) by debbugs.gnu.org; 16 Mar 2024 23:09:49 +0000 Received: from localhost ([127.0.0.1]:57298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rld9x-0002ik-CO for submit@debbugs.gnu.org; Sat, 16 Mar 2024 19:09:49 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rld9w-0002iU-0U for 69832@debbugs.gnu.org; Sat, 16 Mar 2024 19:09:48 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id BF11080D40; Sat, 16 Mar 2024 19:09:04 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1710630543; bh=KZGY3wbvnhwCvHJGaTQiCl/zD4vsTcQE2LqTNzvZBJw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=QosGXfhnv4t+I/A1iEpevAcY5OdDglXJODUNTtigzihYA02ntdKJWGyQSpcF7rxxY Rxis6Nv3pcqT/huqV96URomQ8GddXYrdMR2tJmIejDgS3a3EKJm+Ws06PbOD8N0FJ/ IUSOkOYjfIBsyLq14J50wbjbYv/qOqBPvkV8IV4FruOZ3CzLq3od1Aq3VxsKCC1GcR 1aAIRkKCLwnhoDAduvB6FnQDlPJ1dc74XKLH9FYt3RDPdG8XP0WkdzsZCVP1F6QROu JcIFDTwcQbWvUK2vZtE9cmxoPqsRhpmFG3OqZuEdWYjHIqlLqw3USisZNBhYOgqPss 0SSgqOzItU8/w== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id A59B680946; Sat, 16 Mar 2024 19:09:03 -0400 (EDT) Received: from alfajor (unknown [104.247.238.200]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 7E046120642; Sat, 16 Mar 2024 19:09:03 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms? In-Reply-To: <86edca53u2.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Mar 2024 22:17:25 +0200") Message-ID: References: <86il1m55bk.fsf@gnu.org> <86edca53u2.fsf@gnu.org> Date: Sat, 16 Mar 2024 19:08:56 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.307 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69832 Cc: 69832@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> - 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 From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 17 02:02:28 2024 Received: (at 69832) by debbugs.gnu.org; 17 Mar 2024 06:02:28 +0000 Received: from localhost ([127.0.0.1]:57523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rljbI-0005l5-6A for submit@debbugs.gnu.org; Sun, 17 Mar 2024 02:02:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48500) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rljbG-0005ks-Ep for 69832@debbugs.gnu.org; Sun, 17 Mar 2024 02:02:27 -0400 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 1rljaZ-0007nt-LG; Sun, 17 Mar 2024 02:01:43 -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=Gp7F07wyufk+U2yu0bsY1clZ116kdbb7GX/+eG2/XDQ=; b=lLPR7PzQiXZK +Qgrk8EkOEJRTa3XuhkqUvXcXzAueTsqV8SZJn5TnanNvun1QpA8Sps0pOXapfda8G675mVNX+wrl SaBQm+7lIB85BxJm0hAD2VKW6S28JdMv3vVq5oUnraulM6oU4ZxwDi2mWz9/KMAO+jQR7bsA/Rp/1 5g4MPZMChBh4C8iwTaLi5j19QayKHe9V0irfyBcj09ym0yOhusfLwzzGoCn3Iol6QKJuxO5h31ZAm mZYWLFYRYViGQiXBGeUY23wP71Hc0APXVFgRBcxqv6UwT9WJ7wTl8deGOQBoNDezW4Rg1nJ/7ucPN w0g5QhiPI5MVAHVQQKwK8g==; Date: Sun, 17 Mar 2024 08:01:38 +0200 Message-Id: <86cyrt5rct.fsf@gnu.org> From: Eli Zaretskii To: Stefan Monnier In-Reply-To: (message from Stefan Monnier on Sat, 16 Mar 2024 19:08:56 -0400) Subject: Re: bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms? References: <86il1m55bk.fsf@gnu.org> <86edca53u2.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69832 Cc: 69832@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Stefan Monnier > Cc: 69832@debbugs.gnu.org > Date: Sat, 16 Mar 2024 19:08:56 -0400 > > >> - 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. Well, you asked for opinions, and here you have mine. I stand by it. From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 17 17:04:48 2024 Received: (at 69832-done) by debbugs.gnu.org; 17 Mar 2024 21:04:48 +0000 Received: from localhost ([127.0.0.1]:40994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlxgW-00082e-4q for submit@debbugs.gnu.org; Sun, 17 Mar 2024 17:04:48 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:7755) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlxgU-00082K-Ht for 69832-done@debbugs.gnu.org; Sun, 17 Mar 2024 17:04:46 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F2FE6441647; Sun, 17 Mar 2024 17:04:02 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1710709441; bh=q4s1kYl8i1Z/1TyYlxoD2O/GE+cZ+r6MhzvRvAGRoJo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DdnZLK2lvf9MkR752grajNw5SmzPIcZR7w/uPbOnLQX77ij270Bwb7lWDBjG8bPw9 zdE4kk7rqtOwyTonrlYHwUEwvcRSx6WX4cTaL2kx80n9KVGG4hpS8l5gPVPtvQnycC nzpkAaiLNz+qFwSN2MgRLGzXn+EmnCk7i1N1kJ2rB6tsVEHWd7jADpTz1G2Ji8lJzH 6HApaGz8gPTC8n+aM/kV4rB/39qwl0sOcVr8jCDydms91K0x0c4JkOOQDyF/Hhbdtu bQn0bx8BlpJLdvdV6IHLiH6r7yAghkSHu03KVsUwltxei+RYFyCxPz7irvdRL3Y+D9 PglXuobx3qRTg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C0B8544163B; Sun, 17 Mar 2024 17:04:01 -0400 (EDT) Received: from alfajor (unknown [104.247.238.200]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9554F12044C; Sun, 17 Mar 2024 17:04:01 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#69832: 30.0.50; Should `subr-primitive-p` apply to special-forms? In-Reply-To: <86cyrt5rct.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 17 Mar 2024 08:01:38 +0200") Message-ID: References: <86il1m55bk.fsf@gnu.org> <86edca53u2.fsf@gnu.org> <86cyrt5rct.fsf@gnu.org> Date: Sun, 17 Mar 2024 17:03:59 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.441 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69832-done Cc: 69832-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Well, you asked for opinions, and here you have mine. I stand by it. Fair enough. I'll go with a new `primitive-function-p`, then. I'll include it in the `cl-type-of` patch(es). Stefan From unknown Tue Jun 17 20:10:54 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 15 Apr 2024 11:25:21 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator