[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page

Top Document: FAQ: Lisp Frequently Asked Questions 2/7 [Monthly posting]
Previous Document: [2-20] What is a "Lisp Machine" (LISPM)?


[2-21] How do I tell if a symbol names a function and not a macro?



FBOUNDP tests whether the symbol is globally bound to an operator
(e.g., a function, macro, or special form). SYMBOL-FUNCTION returns
the contents of a symbol's "function slot" if the symbol names a
function. But if the symbol names a macro or special form, it is
completely unspecified what a call to SYMBOL-FUNCTION will return.
Instead, use code like the following to test whether a symbol names a
function: 

   (defun fbound-to-function-p (symbol)
     (and (fboundp symbol)
          (not (macro-function symbol))
          (not (special-operator-p symbol))))

----------------------------------------------------------------
;;; *EOF*



Top Document: FAQ: Lisp Frequently Asked Questions 2/7 [Monthly posting]
Previous Document: [2-20] What is a "Lisp Machine" (LISPM)?

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page


[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
ai+lisp-faq@cs.cmu.edu

Last Update July 24 2008 @ 00:14 AM

© 2008 FAQS.ORG. All rights reserved.