From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id C7C9EBC69 for ; Wed, 21 Feb 2007 22:51:51 +0100 (CET) Received: from mail.davidb.org (mail.davidb.org [66.93.32.219]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1LLplva009114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 21 Feb 2007 22:51:51 +0100 Received: from localhost ([127.0.0.1]) by mail.davidb.org with esmtpa (Exim 4.62 #1 (Debian)) id 1HJzNF-0007gO-Rd; Wed, 21 Feb 2007 13:51:41 -0800 Message-ID: <45DCBEED.10706@davidb.org> Date: Wed, 21 Feb 2007 13:51:41 -0800 From: David Brown User-Agent: Thunderbird 1.5.0.9 (X11/20061221) MIME-Version: 1.0 To: Sam Steingold Cc: Christian Lindig , Caml List Subject: Re: [Caml-list] warning on value shadowing References: <45DCAE89.1050904@gnu.org> <97C89459-B045-4700-8333-FAE31EC648E0@cs.uni-sb.de> <45DCB558.6000601@podval.org> In-Reply-To: <45DCB558.6000601@podval.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 45DCBEF3.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; lindig:01 foo:01 quux:01 foo:01 avoided:01 arbitrarily:01 compiler:01 haskell:01 haskell:01 ocaml:01 2007,:98 wrote:01 wrote:01 caml-list:01 referenced:01 Sam Steingold wrote: > Christian Lindig wrote: >> >> On Feb 21, 2007, at 9:41 PM, Sam Steingold wrote: >> >>> Proposal: When both foo.ml and bar.ml define zot and quux.ml opens >>> both Foo and Bar, there should be a warning [..] >> >> While I see your concern I think open is best avoided. > > Yes, of course. Alas, I am not at liberty to arbitrarily and > pervasively change a huge code-reviewed project to satisfy my > stylistic preferences. I just see no reason for the compiler not to > issue such a warning. One could also argue that this condition is an error. The closest equivalent in Haskell is erroneous (only when the symbol is referenced). Of course Haskell gives a lot more control over the importing or names, and is declarative, so it isn't equivalent at all. The problem with this as a warning, is that outside of multiple modules, this scenario is fairly common: let x = ... let x = ... x ... Since ocaml uses the most recent declration, this is well defined, as it is with multiple 'open's. Dave