[plt-scheme] required else for if ?

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Sep 8 21:17:58 EDT 2009

Static analysis? See PLiiT solved it using the ultimate static  
analysis tool! That's 50bucks for the consulting :-]


On Sep 8, 2009, at 9:03 PM, Grant Rettke wrote:

> On Tue, Sep 8, 2009 at 12:06 PM, John Clements<clements at brinckerhoff.org 
> > wrote:
>> A much more evil manifestation of this occurs when you have a one- 
>> armed if,
>> e.g. :
>>
>> (if button-is-pressed?
>>  (launch-missiles))
>>
>> ... and it's not working, so you stick a printf in there:
>>
>> (if button-is-pressed?
>>  (printf "x = ~v\n" x)
>>  (launch-missiles))
>>
>> And suddenly the missiles launch without the button being pressed.
>>
>> Stupid, yes, but I've spent at least one late night tracking down  
>> this bug.
>
> This is a common "enterprise" bug. If I had my way everyone's static
> analysis tools would prevent this at work.



Posted on the users mailing list.