From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 8C5A27EE49 for ; Thu, 19 Sep 2013 11:29:15 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.17.12; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=mailfrom; client-ip=212.227.17.12; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.17.12; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmgCAEfDOlLU4xEMlWdsb2JhbABBGoM/vECFP4EiFg4BAQEBBw0JCRIqgiUBAQUMGwsBVgsYCSUPBSiIJAEWCDavCB+KGo42gTgWgwiBAAOUH4NcgTCEbo5+ X-IPAS-Result: AmgCAEfDOlLU4xEMlWdsb2JhbABBGoM/vECFP4EiFg4BAQEBBw0JCRIqgiUBAQUMGwsBVgsYCSUPBSiIJAEWCDavCB+KGo42gTgWgwiBAAOUH4NcgTCEbo5+ X-IronPort-AV: E=Sophos;i="4.90,936,1371074400"; d="scan'208";a="33496366" Received: from mout.web.de ([212.227.17.12]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 19 Sep 2013 11:29:14 +0200 Received: from frosties.localnet ([95.208.119.3]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MIN5j-1VLDtt1ctj-004AqB for ; Thu, 19 Sep 2013 11:29:14 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.80) (envelope-from ) id 1VMaXx-0006pF-Od for caml-list@inria.fr; Thu, 19 Sep 2013 11:29:13 +0200 Date: Thu, 19 Sep 2013 11:29:13 +0200 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20130919092913.GB25801@frosties> References: <52385142.7030402@etorok.net> <52385DFF.40806@etorok.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <52385DFF.40806@etorok.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:Jq1ejPzJmNOflpmBAMcYfa0QeRryAc5iJHjTy2KMYovvnN5Agb7 c9TdlCYq6LM684lEp11C/lhfpcT5K94po4tVBAQia3T9BjlPureBrlTV1P52xqAaEcGFSCF sM139KA32AemYDHiUCgLz+5X950TUuma6FUlhZO5byR8PMiwYYWNlBmYqBe3iF/xCVsbqNA t5JpFoBP2bvKitbkpJm9A== Subject: Re: [Caml-list] duplicate labels On Tue, Sep 17, 2013 at 04:49:51PM +0300, Török Edwin wrote: > On 09/17/2013 04:09 PM, Gabriel Scherer wrote: > > I think this is also related to > > http://caml.inria.fr/mantis/view.php?id=6070 > > > > Note that enabling warning 27 (non-suspicious unused variables) also solves this issue: > > > > % ocaml -w +27 > > OCaml version 4.00.1 > > > > # let foo ~x ~x () = x;; > > Warning 27: unused variable x. > > val foo : x:'a -> x:'b -> unit -> 'b = > > I thought that is just because I don't use x in the function, but you are right it warns even if I use x > and I have the duplicate label: > > # let foo ~x ~x () = x;; > Warning 27: unused variable x. > val foo : x:'a -> x:'b -> unit -> 'b = > > I think thats good enough for me now, I'll pay more attention to the unused variable warning. > > Best regards, > --Edwin What about this code? # let foo y ~x = 2 * x + y;; val foo : int -> x:int -> int = # let bar ~x = foo x;; val bar : x:int -> x:int -> int = # let x = 1;; val x : int = 1 # bar ~x ~x;; - : int = 3 # bar ~x:1 ~x:2;; - : int = 5 Other than being confusing there doesn't seem to be anything wrong with a duplicate label. It just requires you to apply the ~x in order. MfG Goswin