Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2007-02-21 (22:13)
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.