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.8 required=5.0 tests=AWL,DNS_FROM_RFC_POST, HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 0FDD5BB84 for ; Wed, 13 Aug 2008 13:51:33 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqoBAAFookhA6ba8lGdsb2JhbACCLzAtjiw+AQEBAQkDCgcRA50lh0wBAg X-IronPort-AV: E=Sophos;i="4.32,201,1217800800"; d="scan'208";a="15964621" Received: from nf-out-0910.google.com ([64.233.182.188]) by mail3-smtp-sop.national.inria.fr with ESMTP; 13 Aug 2008 13:50:59 +0200 Received: by nf-out-0910.google.com with SMTP id b11so984178nfh.13 for ; Wed, 13 Aug 2008 04:50:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type:references; bh=hVpwlB9DfRKbpo6RkFYM/VXdwa408JMQJnT5NGqx+50=; b=Qq9GGK1hx9cc+XaIyqw/uCXmlNb23ZfwEf3+gM062wH+zPiehuD7u6tJEh9TarS3NG XjdRkeIA5hjbV17R2Bfw1yiQbZSJXauN8EoiWjt7sh+zwmHm4n2sFNXjphiTJTXF51QX Zpu/yo6mW/n2VzhFnFn8LlgqAccCWIICKuX4E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:references; b=F/weL3YVG5YuarfvNJGFecrTz9NB/kNFgsVJ4heVdwIsGFfRUI6rCqBLIVWUmmPkXx r8b7MTAEzBLzEbRZ8m+FWKZkabfR4vZnUrrJdZblhojuqDt/5Wtmg94UzO/RlslPOggx G0HSMHnmQgunzctcI/L7g49Yv7RxqaflLsxqE= Received: by 10.210.109.10 with SMTP id h10mr7423053ebc.16.1218628258550; Wed, 13 Aug 2008 04:50:58 -0700 (PDT) Received: by 10.210.72.8 with HTTP; Wed, 13 Aug 2008 04:50:58 -0700 (PDT) Message-ID: <527cf6bc0808130450v70351c6vab0c961cbc6a61c8@mail.gmail.com> Date: Wed, 13 Aug 2008 13:50:58 +0200 From: "blue storm" To: "David Allsopp" Subject: Re: [Caml-list] Value shadowing Cc: "OCaml List" In-Reply-To: <9E2C98C8798A487DAE77F20A9DC4F1E8@countertenor> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_67413_3276516.1218628258554" References: <9E2C98C8798A487DAE77F20A9DC4F1E8@countertenor> X-Spam: no; 0.00; camlp:01 camlp:01 recursive:01 bindings:01 recursive:01 bindings:01 storm:98 preprocessor:01 preprocessor:01 caml-list:01 mly:01 mly:01 modules:02 modules:02 binding:02 ------=_Part_67413_3276516.1218628258554 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Here is a draft of camlp4 extension warning on value shadowing : http://bluestorm.info/camlp4/dev/pf_shadow/list.php You can use it as a preprocessor to your source file, and it will raise warnings on value shadowing. For example (more examples in the test.ml file), your input gives the warning : File "input.ml", line 4, characters 6-8: shadowing binding 'xs' from File "input.ml", line 2, characters 8-10 Recursive bindings are handled, but classes, types and modules are not : it is a reasonable proof of concept, and if somebody is interested in more exhaustiveness, i (or whoever) could probably extend it easily. ------=_Part_67413_3276516.1218628258554 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Here is a draft of camlp4 extension warning on value shadowing :
  http://bluestorm.info/camlp4/dev/pf_shadow/list.php

You can use it as a preprocessor to your source file, and it will raise warnings on value shadowing.
For example (more examples in the test.ml file), your input gives the warning :
<W> File "input.ml", line 4, characters 6-8: shadowing binding 'xs' from File "input.ml", line 2, characters 8-10

Recursive bindings are handled, but classes, types and modules are not : it is a reasonable proof of concept, and if somebody is interested in more exhaustiveness, i (or whoever) could probably extend it easily.
------=_Part_67413_3276516.1218628258554--