[Haskell-cafe] Proposal: Non-recursive let

i c ivan.chollet at gmail.com
Wed Jul 24 00:58:41 CEST 2013


Static analysis is not confused by shadowing, it is confused by the file
descriptor leak, which it can't find in the general case.
Static analysis can only go as far as warning you that some variables are
shadowed, and you will ignore such warning since you're doing variable
shadowing purposely.
This was what I meant by my comment.


On Tue, Jul 23, 2013 at 9:02 PM, David Thomas <davidleothomas at gmail.com>wrote:

> It strikes me as unlikely static analysis would be confused by shadowing.
>
>
> On Tue, Jul 23, 2013 at 12:37 PM, i c <ivan.chollet at gmail.com> wrote:
>
>> let's consider the following:
>>
>> let fd = Unix.open ...
>> let fd = Unix.open ...
>>
>> At this point one file descriptor cannot be closed. Static analysis will
>> have trouble catching these bugs, so do humans.
>> Disallowing variable shadowing prevents this.
>> The two "fd" occur in different contexts and should have different names.
>>
>>
>>
>> On Tue, Jul 23, 2013 at 8:17 PM, Bardur Arantsson <spam at scientician.net>wrote:
>>
>>> On 2013-07-22 17:09, i c wrote:
>>> > Usage of shadowing is generally bad practice. It is error-prone. Hides
>>> > obnoxious bugs like file descriptors leaks.
>>>
>>> These claims need to be substantiated, I think.
>>>
>>> (Not that I disagree, I just think that asserting this without evidence
>>> isn't going to convince anyone who is of the opposite mindset.)
>>>
>>> Regards,
>>>
>>>
>>>
>>> _______________________________________________
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe at haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130723/ded6c327/attachment.htm>


More information about the Haskell-Cafe mailing list