From: Robert Muller
Subject: Survey question
Date: 
Message-ID: <26250@bu-cs.BU.EDU>
Informal survey question for LISPers and Schemers:

 What type of object is read in:
----

> (read)
(lambda (x) x)

----

From: Alex S. Crain
Subject: Re: Survey question
Date: 
Message-ID: <1373@umbc3.UMD.EDU>
In article <·····@bu-cs.BU.EDU> ······@bu-cs.BU.EDU (Robert Muller) writes:

> What type of object is read in:

>> (read)
>(lambda (x) x)

	A list, specifically (LAMBDA . ((X . nil) . (X . nil)))
-- 
					:alex.
					Systems Programmer
···········@umbc3.umd.edu		UMBC
····@umbc3.umd.edu
From: Michael Sokolov
Subject: Re: Survey question
Date: 
Message-ID: <3320@mit-amt>
>(setq foo (read))
>(lambda (x) x)

	I think the question was what type of object is foo bound to?
I think it is basically just a list. (fboundp 'foo) returns nil.
however, (funcall foo 1) does return 1.  Accordingly, (functionp foo)
returns t. I discovered that (functionp 'bar) also returns t, in spite
of the fact that bar was previously unbound: anyone know why?

MS
From: Eliot Handelman
Subject: functionp, fboundp (was: Re: Survey question)
Date: 
Message-ID: <4593@phoenix.Princeton.EDU>
In article <····@mit-amt> ·······@media-lab.media.mit.edu (Michael Sokolov) writes:
>>(setq foo (read))
>>(lambda (x) x)

>	I think the question was what type of object is foo bound to?
>I think it is basically just a list. (fboundp 'foo) returns nil.

Since READ doesn't call EVAL it is just returning a cons. If you need
to have the arguments evaled then you have to write (eval (read)).
That would cause an error in the above example, since LAMBDA is not
a function. 

>however, (funcall foo 1) does return 1.  Accordingly, (functionp foo)
>returns t. I discovered that (functionp 'bar) also returns t, in spite
>of the fact that bar was previously unbound: anyone know why?

FUNCTIONP only says whether its argument is suitable to passed to FUNCALL,
which is true of all symbols. If you want to find out if a symbol has a 
global function definition attached to it you have to use FBOUNDP.

There was some discussion a while back -- though I think it may have been
in the KCl list -- as to what the point of FUNCTIONP was. I think it was
generally agreed that it was pretty pointless. I don't recall whether
X3J13 was planning on rethinking it or not -- perhaps someone from there
might fill us in on the latest update.