Page 1 of 1

compiled-function-p on closures

Posted: Thu Feb 03, 2011 12:40 pm
by FAU
Hi there,

Look at this:

(defun foo (x) x)
(compile 'foo)
(compiled-function-p #'foo) ; => T

But:

(let ((y 2))
(defun foo (x) (* x y)))
(compile 'foo)
(compiled-function-p #'foo) ; => NIL

Shouldn't its value be T?

System: CCL-1.6

Re: compiled-function-p on closures

Posted: Thu Feb 03, 2011 1:18 pm
by ramarren
Well, the Hyperspec for COMPILE says:
Hyperspec wrote:Exceptional Situations:

The consequences are undefined if the lexical environment surrounding the function to be compiled contains any bindings other than those for macros, symbol macros, or declarations.
I never noticed that before. SBCL gives T here.