From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: Subrp returns nil for function objects and symbols? Is this a bug or me misunderstanding it? Date: Tue, 13 Aug 2024 13:08:49 +0200 Message-ID: <87h6bo8yta.fsf@gmx.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20636"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "emacs-devel@gnu.org" To: arthur miller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Aug 13 13:09:57 2024 Return-path: Envelope-to: ged-emacs-devel@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 1sdpPY-0005G6-Hp for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Aug 2024 13:09:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sdpOq-00065h-Kl; Tue, 13 Aug 2024 07:09:12 -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 1sdpOn-00063q-JC for emacs-devel@gnu.org; Tue, 13 Aug 2024 07:09:09 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sdpOg-0006Fj-N3 for emacs-devel@gnu.org; Tue, 13 Aug 2024 07:09:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1723547330; x=1724152130; i=stephen.berman@gmx.net; bh=MC872il2UaZfa8EBPwwEkK+bHRvSOePAfzu5tBENTuI=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=XykjMjgrqVrHDz2CxP1cy/j4imIdHvaQhPL7jQkZIqXqp5sqVYCh5WXGc1l0wyZ8 sgqdz3cOXXYMTPKVZsIhDiuoM7z1KPeLq02dxg9VY9E8C7njjlkltURQ99IHkC9K8 ZaMWRiSr7eaQA4jkhez08Nucv/Qdvofj7ZZJ88FG8tqx6BlE3T0sVl1IKuAYR80DE IjY4XgeOvlyiztZQQU+4lgyNwXlbWyhOg4NfUb3bo3xELcmxjgPeJOp/iJUyphbXi asx4GaBhRAalXtPZgZ0r245GJCccZK/CfweFaj5grqk2zLUOQecYznPiSXSjjzAZV JuIivsXG0/6HSRuwQA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfs ([94.134.94.142]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mdeb5-1s4Udv1xAn-00ZTlT; Tue, 13 Aug 2024 13:08:50 +0200 In-Reply-To: (arthur miller's message of "Tue, 13 Aug 2024 09:22:01 +0000") X-Provags-ID: V03:K1:kqIzE0xS73/pmLchAojEOMAe8D7FeLIWy+iFfmMNzHPR3oUh0JC CRY8iKCgpg8/dpX1q5DQLHdK1lPZ2ELZRWkt2GalPEsPHtegofWziomUkPBrU8aOX+r0rZN fR9mTo7oprDktg30l52RBGn/anR+F/sgmoOxjrGZvNiq1DTX//sqT3Jg/fnp0yLdDx57ZVZ nXoMbcnnxK39Nfi78fB7w== UI-OutboundReport: notjunk:1;M01:P0:j5TE8LtVEVU=;3Dv9FoLqTwRUb7WPRGPB4LAXsLg SUnVtNbhtAihJh1TnKpoIylEGneXrcaYSfBDHkKHRHy4ss8ZuRiLMfSRVL4fmHQzbeH6TfxBY ArI5Y7bZRy8rwsq1JJz5XhuNLoYPm5ybi1jldlm1rCGWs4nSTrKt4CjrJTug3GZQDHpD4bo5g xny+O97YQh++oFbN0pceTUPMpq/Vg2ZZLpRUaZk+vhZzQRGL/tKy0H4Tr1CsBNhZ31h2FWwxJ 4VkDEKWq11467kkVKYCpvdbUzlS+kWu0Ycam1/00E7e6zqio4gLCJ3YsFiDzkCbNtrhuIL3oq t3jErlTnndg8L9tslRmeABeVNBfP6e4LVLE6zBXIotWeTu0MDPdZcCiy9Dm1QRAnZkAfSYnRd NmHM3Elo0GtEU+SrgZ+PJEQLCDZHK/jwo0c4eINUekSJhIkpK4iU0/iE//hbjR0EqRzApIYQP rc3sNr6q7NEv4IT58DSNtMHZk//0N4ZF37nzE3Y+kqmp+u1uZWxhLfsrpuSxMjlHqTHUZCoyh KtOMMKkOOxsSNir2aa7GhgW7Gpb6oh+ToPyB0N+nq93QnutzkriQALLYrNpswH4K7Kg0yMHcr 4APh8R+vPdM00qs2EKBh1qY+2Q+l3HHCjDWG/l/mJBYw7wxsUW9T765yyh6EGvA66jFhW5tP1 /1tP99iuEph3cgZdNZbizl12OPycpbJjeSgmIU6HV0411Xs2yLx4GeL+KOAN2mz0LX9t3+JjX ipV9T8v5dCaxpwSu71M0ZVN+hBo0w7q6j/z9vykDr+T9hDC0+Ksw4S8tK76NaA2zBPIw+vAX Received-SPF: pass client-ip=212.227.15.18; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322700 Archived-At: On Tue, 13 Aug 2024 09:22:01 +0000 arthur miller w= rote: > (subrp 'car) =3D> nil > (subrp #'car) =3D> nil > (subrp '+) =3D> nil > > (subrp (symbol-function 'car)) =3D> t > > According to the doc, subrp should tell me if "OBJECT" is a built-in > function or not. I would expect "car" to be that, since car is implemented > in the C source (in data.c). > > I also get the same behavior for compiled-function-p. > > Is it not valid to pass a symbol and function objects to those two > functions? Can we in that case clarify in the doc string expected > value(s) for OBJECT? At least it's documented in the Elisp manual (info "(elisp) What Is a Function"): Unlike =E2=80=98functionp=E2=80=99, the next functions do _not_ treat a s= ymbol as its function definition. =20=20 -- Function: subrp object This function returns =E2=80=98t=E2=80=99 if OBJECT is a built-in fu= nction (i.e., a Lisp primitive). =20=20 (subrp 'message) ; =E2=80=98message=E2=80=99 is a sy= mbol, =E2=87=92 nil ; not a subr object. (subrp (symbol-function 'message)) =E2=87=92 t Steve Berman