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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 81677BC69 for ; Wed, 21 Feb 2007 23:56:28 +0100 (CET) Received: from orion.metastack.com (no-dns-yet.demon.co.uk [80.177.38.218] (may be forged)) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1LMuRPj026065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 21 Feb 2007 23:56:28 +0100 Received: from treble (cpc2-cmbg6-0-0-cust535.cmbg.cable.ntl.com [81.107.34.24]) (authenticated bits=0) by orion.metastack.com (8.13.4/8.13.3) with ESMTP id l1LM9luX002084 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 21 Feb 2007 22:09:48 GMT From: "David Allsopp" To: References: <20070221223151.97901BC76@yquem.inria.fr> Subject: Re: [Caml-list] warning on value shadowing Date: Wed, 21 Feb 2007 22:56:26 -0000 Organization: MetaStack Solutions Ltd. Message-ID: <00f301c7560b$84b8c8c0$6a7ba8c0@treble> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <20070221223151.97901BC76@yquem.inria.fr> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: AcdWAa/vF/rgU1zSTGa7fcBeDVkOGQAB1dBg X-Miltered: at concorde with ID 45DCCE1B.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; foo:01 quux:01 foo:01 quux:01 redefining:01 pervasives:01 wrote:01 imho:01 clearer:01 caml-list:01 define:01 compiling:02 renaming:02 programming:03 module:03 > On Wednesday 21 February 2007 20:41, 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 (when compiling quux) about Foo.zot being > > shadowed by Bar.zot (or vice versa, depending on the order of the open > > statements). > > I think this is such a common style (I use shadowing deliberately all the > time) that it would be very annoying to be warned about it. I agree --- local shadowing is too useful a programming style to have warnings issued. Though redefining a value at global level is possibly worth having a warning about. IMHO Pervasives is the only module that should be opened --- renaming a module with "module Foo = SomeVeryLongModuleNameYouDontWantToTypeLots" is better (makes clearer code) than "open ... ". But that's just another opinion...