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
compiled-function-p on closures
Re: compiled-function-p on closures
Well, the Hyperspec for COMPILE says:
I never noticed that before. SBCL gives T here.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.