[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Checking if a function is built-in
From: |
Drew Adams |
Subject: |
RE: Checking if a function is built-in |
Date: |
Tue, 10 Jun 2008 15:51:05 -0700 |
> > > 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).