The two "fd" occur in different contexts and should have different names.Disallowing variable shadowing prevents this.At this point one file descriptor cannot be closed. Static analysis will have trouble catching these bugs, so do humans.let fd = Unix.open ...let's consider the following:let fd = Unix.open ...
On Tue, Jul 23, 2013 at 8:17 PM, Bardur Arantsson <spam@scientician.net> wrote:On 2013-07-22 17:09, i c wrote:These claims need to be substantiated, I think.
> Usage of shadowing is generally bad practice. It is error-prone. Hides
> obnoxious bugs like file descriptors leaks.
(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@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe