Version française
Home     About     Download     Resources     Contact us    
Browse thread
warning on value shadowing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Brown <caml-list2@d...>
Subject: Re: [Caml-list] Re: warning on value shadowing
Sam Steingold wrote:

>> The problem with this as a warning, is that outside of multiple
>> modules, this scenario is fairly common:
>>
>>   let x = ...
>>   let x = ... x ...
>>

> 3 shadow a global value with a local one (warning)
> 4 redefine a local value as in your example (no warning)

I guess my example was a little ambiguous.  Those were meant to be
top-level bindings.  I've seen this construct fairly commonly.  It is
especially useful when making something that wraps around another
call, adding a bit more functionality.

Dave