[cmucl-imp] Re: Compiled COMPILE forms at load time Bug

Raymond Toy toy.raymond at gmail.com
Mon Mar 15 16:18:46 CET 2010


On 3/15/10 10:45 AM, Helmut Eller wrote:
> * Raymond Toy [2010-03-15 15:01+0100] writes:
>
>   
>> On 3/12/10 11:45 AM, Helmut Eller wrote:
>>     
>>> * Raymond Toy [2010-03-12 12:35+0100] writes:
>>>
>>>   
>>>       
>>>> So COMPILE has silently zapped the structure.  We should probably print
>>>> he warning for this too.
>>>>     
>>>>         
>>> Yes, definitely.  Also for this:
>>>
>>> (defstruct xyz a)
>>> (setf (fdefinition 'xyz-a) (lambda () 42))
>>>   
>>>       
>> I added a hook to *setf-fdefinition-hook* to check for this case.  Works
>> ok, but now I can't compile clx/depdefs.lisp.  CMUCL complains about
>> redefining reply-size and buffer-lock which are slot accessor
>> functions.  But I haven't figured out from the code where the
>> redefinition is coming from.
>>
>> Also,  consider this:
>>
>> (defstruct abc a b c)
>> (defun abc-a () 42)
>>
>> CMUCL undefines the structure, but
>>     
> CMUCL undefines the structure?  That seems a bit aggressive.  I think it
> should only delete the (c:info function info 'abc-a) entry if that's not
> done yet.  The compiler uses that to recognize "known" functions.
>   
The code that does this is define-function-name in proclaim.lisp.  If
the name is an accessor-for, then undefine-structure is called.   The
comment for undefine-structure says it's supposed to blow away all
compiler info and undefining all associated functions.
> I don't know if (setf abc-a) still works if the info entry for abc-a is
> cleared.
>
>   
>> (defstruct abc a)
>>
>> produces an error about incompatibly redefining the structure.
>>     
> That seems totally OK to me.
>   
Well, I was expecting that if we undefined the structure, then there
would be no information about the structure, and hence didn't exist.  
But perhaps that can't be completely true if there are already structure
objects of that type.
>
>> If we undefined the structure, I would expect make-xyz (or make-abc) not
>> to work.
>>
>> What to do?
>>     
> I wouldn't undefine the entire structure; only redefine the named
>   
That's the historical behavior, but I don't think I've ever run into
this before, even when playing around.  I only noticed this when looking
at compile and define-function-name to see how things worked.
> accessor function.  For the printer we could come up with something like
> SLOT-VALUE but it should work without PCL.
>   
There's probably some way to do this without PCL.

Ray




More information about the cmucl-imp mailing list