unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: 'Nordlöw' <per.nordlow@gmail.com>, help-gnu-emacs@gnu.org
Subject: RE: Checking if a function is built-in
Date: Tue, 10 Jun 2008 15:51:05 -0700	[thread overview]
Message-ID: <009801c8cb4c$775632f0$0200a8c0@us.oracle.com> (raw)
In-Reply-To: <c9e0f6b3-5b4b-4493-b7e0-c959249e717e@p25g2000hsf.googlegroups.com>

> > > 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).





  reply	other threads:[~2008-06-10 22:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-10 21:08 Checking if a function is built-in Nordlöw
2008-06-10 21:18 ` Marc Tfardy
2008-06-10 21:46   ` Lennart Borgman (gmail)
2008-06-10 21:50 ` Drew Adams
2008-06-10 22:08   ` Drew Adams
     [not found] ` <mailman.13020.1213134665.18990.help-gnu-emacs@gnu.org>
2008-06-10 22:06   ` Nordlöw
2008-06-10 22:29   ` Nordlöw
2008-06-10 22:51     ` Drew Adams [this message]
     [not found]     ` <mailman.13025.1213138324.18990.help-gnu-emacs@gnu.org>
2008-06-10 23:11       ` Nordlöw

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='009801c8cb4c$775632f0$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=per.nordlow@gmail.com \
    /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.
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).