[Openmcl-devel] Compiler warnings

Taoufik Dachraoui taoufik.dachraoui at wanadoo.fr
Sun Oct 18 04:26:45 PDT 2009


Where do you see declared the in the specs? I see "values returned by  
form".


On Oct 18, 2009, at 1:19 PM, Ron Garret wrote:

>
> On Oct 18, 2009, at 4:05 AM, Taoufik Dachraoui wrote:
>
>> Sorry but I have to insist.
>>
>
> Insist all you want.  That won't make you right.
Agree, but I insist because I believe that you missunderstood my  
concern, I may be wrong
and I may be right, clear, precise and correct answers may convince me.

>
>> In the CL specs
>>
>> "the specifies that the values[1a] returned by form are of the  
>> types specified by value-type.
>> The consequences are undefined if any result is not of the declared  
>> type."
>>
>> It is clear that (THE type expr)  specifies the the returned value  
>> of expr is of type type.
>>
>
> No, this is not clear.  The only thing that is clear is just what it  
> says, that if the result is not of the declared type then the  
> consequences are undefined.  In CCL, for example:
>
Where do you see "not of the declared"? I see "the values returned by  
form".

> ? (the fixnum 1.2)
> ;Compiler warnings :
> ;   In an anonymous lambda form: Type declarations violated in (THE  
> FIXNUM 1.2)
> 1.2
>
> But this is a red herring.  None of this has anything to do with the  
> warning you are seeing.
>
>> Again the example:
>>
>> ? (setf z 1)
>> 1
>> ? (the fixnum z)
>> ;Compiler warnings :
>> ;   In an anonymous lambda form: Undeclared free variable Z
>> 1
>> ? z
>> 1
>> ? (the fixnum 1)
>> 1
>> ?
>>
>> As you can see, after the SETF z has a value of 1 and (THE fixnum  
>> 1) does not raise a
>> warning but  (THE fixnum z) does, this means to me that the THE  
>> operator does not
>> merely uses the returned value of z but has something too say about  
>> z, and this is wrong
>> I believe.
>
> The exact same thing happens with other operators:
>
But do you agree that the z defined by SETF is a lexical variable?

> ? (setf x 1)
> 1
> ? ((lambda () x))
> ;Compiler warnings :
> ;   In an anonymous lambda form: Undeclared free variable X
> 1
> ? ((lambda () 1))
> 1
> ? (let ((y x)) y)
> ;Compiler warnings :
> ;   In an anonymous lambda form: Undeclared free variable X
> 1
> ? (let ((y 1)) y)
> 1
>
>
> It has nothing to do with THE, it has to do with whether a reference  
> to an undeclared free variable is passed to the compiler, which is  
> what generates these warnings.  Again: this has nothing to do with  
> THE -- except insofar as THE is one construct (among many) that  
> causes the compiler to be invoked.
>
It remains that the THE operator as implemented does not follow the  
specs.

> rg
>

Taoufik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20091018/447576f9/attachment.htm>


More information about the Openmcl-devel mailing list