Re: Compiled COMPILE forms at load time Bug

Raymond Toy <[email protected]>
Newsgroups gmane.lisp.cmucl.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.