unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nordlöw <per.nordlow@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Checking if a function is built-in
Date: Tue, 10 Jun 2008 16:11:22 -0700 (PDT)	[thread overview]
Message-ID: <c29aae9e-26df-4126-86cd-ce7696fe2754@8g2000hse.googlegroups.com> (raw)
In-Reply-To: mailman.13025.1213138324.18990.help-gnu-emacs@gnu.org

On 11 Juni, 00:51, "Drew Adams" <drew.ad...@oracle.com> wrote:
> > > > 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).

Great!

Now I got it!

Many Thanks,
Nordlöw


      parent reply	other threads:[~2008-06-10 23:11 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
     [not found]     ` <mailman.13025.1213138324.18990.help-gnu-emacs@gnu.org>
2008-06-10 23:11       ` Nordlöw [this message]

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=c29aae9e-26df-4126-86cd-ce7696fe2754@8g2000hse.googlegroups.com \
    --to=per.nordlow@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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).