Path: utzoo!utgpu!water!watmath!clyde!rutgers!sunybcs!bingvaxu!leah!itsgw!batcomputer!cornell!uw-beaver!tektronix!reed!trost From: trost@reed.UUCP (Bill Trost) Newsgroups: comp.emacs Subject: Re: functionp Summary: The right way to do it Message-ID: <8098@reed.UUCP> Date: 21 Jan 88 19:14:48 GMT References: <39315@ti-csl.CSNET> <20954@yale-celray.yale.UUCP> Reply-To: trost@reed.UUCP (Bill Trost) Organization: Reed College, Portland OR Lines: 24 In article <39315@ti-csl.CSNET>, ekberg@home (Tom Ekberg) writes: > ... How does the following definition appear to your critical eyes? > > (defun functionp (object) > "Returns t if OBJECT is a function." > (cond ((subrp object) t) > ((commandp object) t) > ((listp object) (eq (car object) 'lambda))) ;modified to be cleaner lisp and to avoid line-counter problems Sorry I'm following up so late on this one, but that's what happens when people go home for Christmas break. Anyhow, what ya'll are most definitely looking is fboundp, which returns t if the argument has a function definition. If you want to get at that definition, use symbol-function. Be warned that macros are strings attatched to the function definition, so you may want to check for that as well. -- ...!(ogcvax|tektronix)!reed!trost @ All characters @ My opinions may or "Ooh ick!" -- Penfold, anonymous @ are ficticious @ may not represent assistant of *Dangermouse*, the @ unless they @ those of my employer, world's Greatest Secret Agent(TM) @ are real. @ etc, etc.