chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] testcase -strict-types


From: Felix
Subject: Re: [Chicken-hackers] testcase -strict-types
Date: Sun, 31 Mar 2013 15:09:23 +0200 (CEST)

From: Felix <address@hidden>
Subject: Re: [Chicken-hackers] testcase -strict-types
Date: Sun, 31 Mar 2013 15:07:33 +0200 (CEST)

> From: John Cowan <address@hidden>
> Subject: Re: [Chicken-hackers] testcase -strict-types
> Date: Sat, 30 Mar 2013 21:14:49 -0400
> 
>> Felix scripsit:
>> 
>>> Strict-types means you declare that variables never change their type,
>>> once a type has been inferred (or explicitly declared). 
>> 
>> That sounds like an excellent feature.  But in that case, if the known
>> procedure `null?` is being called on an expression whose type is known
>> to be the type of (), the call should be replaced with #t, and if it is
>> known *not* to be the type of (), the call should be replaced with #f.
>> In neither case should it be a compile-time error to invoke `null?`
>> in that circumstance, and I don't understand why it currently is.
> 
> It's not a compile-time error, just a warning. The code violates the
> assumptions that -strict-types apply. I'm not sure how to put it
> differently.

Or, in other words, the compiler is pointing out that the code in question
has no usable effect, and is redundant. "Notes" (which are only shown
in verbose mode) are just style-warnings, so to speak.


cheers,
felix



reply via email to

[Prev in Thread] Current Thread [Next in Thread]