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 (23:16)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] warning on value shadowing
On Wed, 2007-02-21 at 13:51 -0800, David Brown wrote:

> >>> Proposal: When both and define zot and opens
> >>> both Foo and Bar, there should be a warning [..]

> One could also argue that this condition is an error.  

IMHO, only an error on use of the ambiguous name.
It should be a hard error then. It can be resolved
by qualification.

I don't believe this is inconsistent with deliberate
hiding like let x = e in let x = x + 1 in .. indeed
this can also be used to resolve a conflict:

open A
open B
let x = A.x 

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: