From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA29299; Thu, 15 Jul 2004 16:23:13 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA29245 for ; Thu, 15 Jul 2004 16:23:11 +0200 (MET DST) Received: from annexia.force9.co.uk (annexia.force9.co.uk [212.56.101.183]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i6FENASH002067 for ; Thu, 15 Jul 2004 16:23:11 +0200 Received: from rich by annexia.force9.co.uk with local (Exim 3.36 #1 (Debian)) id 1Bl78c-0003kJ-00; Thu, 15 Jul 2004 15:23:06 +0100 Date: Thu, 15 Jul 2004 15:23:06 +0100 To: Jacques GARRIGUE Cc: caml-list@inria.fr Subject: Re: [Caml-list] Optional and mandatory labels with the same name in the same function ? Message-ID: <20040715142305.GA14257@redhat.com> References: <20040715115433.GA29454@liafa.jussieu.fr> <20040715.231153.68538428.garrigue@kurims.kyoto-u.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040715.231153.68538428.garrigue@kurims.kyoto-u.ac.jp> User-Agent: Mutt/1.5.5.1+cvs20040105i From: Richard Jones X-Miltered: at concorde with ID 40F6934E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 0900,:01 jacques:01 3.07:01 ignores:01 val:01 val:01 bug:01 type-safe:01 ltd:98 semantics:01 ocaml:01 caml:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Jul 15, 2004 at 11:11:53PM +0900, Jacques GARRIGUE wrote: > Then I suppose that > let f x x = 33 > should also cause a warning, because this has just the same > semantics. It's a bit more subtle than that. OCaml 3.07 always picks the last argument, and ignores the others. Thus: # let f x x = x;; val f : 'a -> 'b -> 'b = # let f x x x x = x;; val f : 'a -> 'b -> 'c -> 'd -> 'd = But a future version might pick the first argument, or one in the middle, or one at random. I can't find any guarantee in the manual that the behaviour won't change, so this might cause a bug. Rich. -- Richard Jones. http://www.annexia.org/ http://www.j-london.com/ Merjis Ltd. http://www.merjis.com/ - improving website return on investment Perl4Caml lets you use any Perl library in your type-safe Objective CAML programs. http://www.merjis.com/developers/perl4caml/ ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners