From: Deepak Goel
Subject: checking if symbol is a function.
Date: 
Message-ID: <Pine.GSO.4.10.9909291537500.12059-100000@fosters.umd.edu>
hi

suppose i have a symbol arg which is say, 'expt or '* or '7, and i want to
check whether the corresponding expt or * or 7 is a defined function or
not.

So i would try (functionp '*) or (functionp '7) viz. i need (functionp
arg), but then there is a missing # because (functionp arg) gives nil
when arg = '*.

So how do i check?

thanks a lot, pls reply to my email-id..


novice-ly yours

--Deepak

From: R. Matthew Emerson
Subject: Re: checking if symbol is a function.
Date: 
Message-ID: <87wvt9cwxn.fsf@nightfly.apk.net>
Deepak Goel <·····@Glue.umd.edu> writes:

> suppose i have a symbol arg which is say, 'expt or '* or '7, and i want to
> check whether the corresponding expt or * or 7 is a defined function or
> not.
> 
> So i would try (functionp '*) or (functionp '7) viz. i need (functionp
> arg), but then there is a missing # because (functionp arg) gives nil
> when arg = '*.
> 
> So how do i check?

Look up fboundp in your favorite CL reference.

-matt
From: Rob Warnock
Subject: Re: checking if symbol is a function.
Date: 
Message-ID: <7t9m70$dfli2@fido.engr.sgi.com>
Deepak Goel  <·····@glue.umd.edu> wrote:
+---------------
| So i would try (functionp '*) or (functionp '7) viz. i need (functionp
| arg), but then there is a missing # because (functionp arg) gives nil
| when arg = '*.
+---------------

That's because '* isn't a function -- it's a symbol. If you
try it with an actual function (such as #'*) it works fine:

	> (defvar arg #'*)
	ARG
	> arg 
	#<Function * {1084019}>
	> (functionp arg)
	T
	>


-Rob

-----
Rob Warnock, 8L-846		····@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		FAX: 650-933-0511
Mountain View, CA  94043	PP-ASEL-IA