help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking if a function is built-in


From: Nordlöw
Subject: Re: Checking if a function is built-in
Date: Tue, 10 Jun 2008 16:11:22 -0700 (PDT)
User-agent: G2/1.0

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]