From: Lyle Borg-Graham
Subject: compiled-function-p and interpreted functions (CMUCL)
Date: 
Message-ID: <LYLE.97Mar21191519@cogni.ai.mit.edu>
Quick question - compiled-function-p doesn't seem to do right with an
interpreted function under CMUCL17F - any ideas?

Thanks to all,

Lyle



* (defun foo (a b c))
FOO
* (describe *) 
FOO is an internal symbol in the SURF-HIPPO package.
Function: #<Interpreted Function FOO {73F0329}>
Function arguments:

In: LAMBDA (A B C)
  #'(LAMBDA (A B C) (BLOCK FOO))
Warning: Variable A defined but never used.
Warning: Variable B defined but never used.
Warning: Variable C defined but never used.
  (A B C)
Its defined argument types are:
  (T T T)
Its result type is:
  *
Its definition is:
  (LAMBDA (A B C) (BLOCK FOO))
* (describe #'foo)
#<Interpreted Function FOO {73F0329}> is function.
Arguments:
  (A B C)
Its defined argument types are:
  (T T T)
Its result type is:
  *
Its definition is:
  (LAMBDA (A B C) (BLOCK FOO))
* (compiled-function-p #'foo)
T
* 
--
............................................................
			      
		      Lyle Borg-Graham
     Equipe Cogniscience, Institut Alfred Fessard, CNRS
		    91198 Gif-sur-Yvette
			   FRANCE
 tel: (33 1) 69 82 34 13           fax: (33 1) 69 82 34 27

								_ o
							       / /
					   .    .   .  . . . _ _/|	

 
From: Barry Margolin
Subject: Re: compiled-function-p and interpreted functions (CMUCL)
Date: 
Message-ID: <5gv26j$dv0@tools.bbnplanet.com>
In article <··················@cogni.ai.mit.edu>,
Lyle Borg-Graham <····@ai.mit.edu> wrote:
>Quick question - compiled-function-p doesn't seem to do right with an
>interpreted function under CMUCL17F - any ideas?

CMU CL compiles everything.  Essentially, it defines:

(defun eval (form)
  (funcall (compile nil `(lambda () ,form))))

But even if this weren't the case, in some implementations
COMPILED-FUNCTION-P is true for all functions.  This is because they
represent interpreted functions using a closure of a compiled function,
something like:

(defun make-interpreted-function (lambda-exp)
  #'(lambda (&rest args) (apply-lambda-exp lambda-exp args)))

The printer recognizes these closures and displays them as #<Interpreted
Function ...>, but in actuality they're really a compiled function.
-- 
Barry Margolin
BBN Corporation, Cambridge, MA
······@bbnplanet.com
(BBN customers, call (800) 632-7638 option 1 for support)