Greetings!  Making the head of 'compile look like 

(defun compile (name &optional def &aux tem gaz (*default-pathname-defaults* 
#"."))

  (cond ((not(symbolp name)) (error "Must be a name"))
        ((or (si::interpreted-function-p def) (and (consp def) (eq (car def) 
'lambda)))
         (or name (setf name 'cmp-anon))
         (setf (symbol-function name)
               def)
         (compile name))
        (def (error "def not a lambda expression"))

will work.  This is going into cvs head, or a cleaned up similar.  It
is not required for 2.6.8, right?

Robert Boyer <[EMAIL PROTECTED]> writes:

> > I suppose it hinges on whether #'f is a lambda expression or a
> > function or something else.
> 
> I'd say that #'f is definitely a function, given this:
> 
>    >(defun f (x) x)
>    FOO
>    >(typep #'f 'function)
>    T
> 
> Based upon what Allegro and ABCL do (along with SBCL and Clisp, as you point
> out), I suspect that GCL really should not cause an error on (compile nil
> #'f), but should somehow extract the LAMBDA and compile it.  Probably very
> easy to do with, given si::interpreted-function-lambda.
> 
> >(si::interpreted-function-lambda (function f))
> 
>   (LAMBDA-BLOCK F (X) X)
> 
> e.g.,
> 
>   (compile nil (cons 'lambda (cddr (si::interpreted-function-lambda (function 
> f)))))
> 
> seems to work ok.  But I have no real understanding of that cddr, of
> si::interpreted-function-lambda, or of LAMBDA-BLOCK.
> 
> Bob
> 
> 
> 
> 
> 
> 
> 

-- 
Camm Maguire                                            [EMAIL PROTECTED]
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah


_______________________________________________
Gcl-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gcl-devel

Reply via email to