Raymond Toy wrote:

> Jonathan Simpson wrote:
>
>> Hey,
>>
>> The following code gives 6 compiler notes on CMUCL 18e which I can't 
>> seem to get rid of.  Its the last three that really bother me.  It 
>> seems to me that if the second make-vector is ok then the third one 
>> should be as well.  Adding "the double-float" everywhere doesn't seem 
>> to help either.
>>
>> If anyone has a solution to this I would be very grateful.  I have 
>> code similar to this in a number of frequently executed functions in 
>> my app.
>
>
> You might want to do
>
> (declaim (inline make-vec3))
>
> This allows make-vec3 to be inlined, and that means the args to 
> make-vec3 don't have to be boxed up, which, I think, is what is the 
> compiler notes for the last two calls to make-vec3 are about.
>
> Ray
>
Thanks.  That did indeed take care of those three pesky notes.  Do you 
happen to know why the compiler can't deduce the types of the make-vec3 
args?  Am I incorrect in thinking that the compiler should be able to 
determine that it is dividing 2 double-floats in this case, and that 2 
double-floats equal another double-float?

Also, I noticed something else strange.  If I use "(declare (inline 
make-vec3))" inside the normalize function instead of declaim, it 
doesn't work.  Does declare work with inline?


Thanks for your help,

Jonathan




Reply via email to