From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Checking if a function is built-in Date: Tue, 10 Jun 2008 15:51:05 -0700 Message-ID: <009801c8cb4c$775632f0$0200a8c0@us.oracle.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1213138350 19808 80.91.229.12 (10 Jun 2008 22:52:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Jun 2008 22:52:30 +0000 (UTC) To: "=?iso-8859-1?Q?'Nordl=F6w'?=" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 11 00:53:12 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K6CiF-0000Jk-Mt for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jun 2008 00:53:11 +0200 Original-Received: from localhost ([127.0.0.1]:33600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6ChS-0002oy-9z for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Jun 2008 18:52:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6Ch8-0002oS-NV for help-gnu-emacs@gnu.org; Tue, 10 Jun 2008 18:52:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6Ch7-0002nF-09 for help-gnu-emacs@gnu.org; Tue, 10 Jun 2008 18:52:01 -0400 Original-Received: from [199.232.76.173] (port=56613 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6Ch6-0002my-N9 for help-gnu-emacs@gnu.org; Tue, 10 Jun 2008 18:52:00 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]:44389) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K6Ch6-00075R-4o for help-gnu-emacs@gnu.org; Tue, 10 Jun 2008 18:52:00 -0400 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m5AMpt1E007288; Tue, 10 Jun 2008 16:51:55 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m5AGN8NK019961; Tue, 10 Jun 2008 16:51:55 -0600 Original-Received: from inet-141-146-46-1.oracle.com by acsmt351.oracle.com with ESMTP id 3690147961213138267; Tue, 10 Jun 2008 15:51:07 -0700 Original-Received: from dradamslap1 (/24.5.171.3) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 10 Jun 2008 15:51:06 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: AcjLS0uEwW6X2W1qSfGvZ5IWG8z0DgAANZgA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54697 Archived-At: > > > Is there a predicate that can check if a function is built-in? > > > > subrp > > I thought this was the way to use it (subrp 'cons) > but it returns nil even though cons is a built-in function. > Have I missed something? (subrp (symbol-function 'cons)) `cons' is just a symbol. What you want to test is the function that the symbol refers to. This is not the value of the symbol but the value of its function cell, which is a function (a subr, in this case).