Compiled COMPILE forms at load time Bug

Raymond Toy toy.raymond at gmail.com
Wed Mar 10 17:26:44 CET 2010


On 3/10/10 9:24 AM, Raymond Toy wrote:
> On 2/14/10 4:15 PM, Helmut Eller wrote:
>>
>> We could probably fix the problem by binding form in compile in
>> main.lisp with something like this:
>>
>> (form (etypecase definition
>>        ((or cons eval:interpreted-function)
>>         `#',(get-lambda-to-compile definition))
>>        (function `',definition)))
>>
>>   
> Oops.  I checked in this change and it's in the March snapshot.  But it
> also breaks something that used to work:
> 
> (defun foo (x y) (+ x y))
> (compile 'foo)
> (compile 'foo)
> 
> This used to work.  Now the second compile generates an error about FOO
> being undefined.

Perhaps the following change would work.  It makes the old behavior work
again, and still fixes the compile form issue:

	     (form (etypecase definition
		     ((or cons eval:interpreted-function)
		      `#',(get-lambda-to-compile definition))
		     (function
		      (multiple-value-bind (exp lexenv)
			  (function-lambda-expression definition)
			(if (and exp (not lexenv))
			    `#',exp
			    `',definition)))))

(Perhaps this can be written in a better way.  The second etypecase
clause is like get-lambda-to-compile, except we don't signal an error.)

I think we still need the additional fix in function-lambda-expression
in case the compiled-debug-info-source is NIL.

Ray



More information about the cmucl-imp mailing list