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 XAA24468; Wed, 5 May 2004 23:18:24 +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 XAA24467 for ; Wed, 5 May 2004 23:18:23 +0200 (MET DST) Received: from null.cs.brown.edu (null.cs.brown.edu [128.148.38.190]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i45LIMSH012119 for ; Wed, 5 May 2004 23:18:23 +0200 Received: from miette (miette [128.148.38.66]) by null.cs.brown.edu (Postfix) with ESMTP id 4494B3CF8 for ; Wed, 5 May 2004 17:18:22 -0400 (EDT) Received: from er by miette with local (Exim 3.36 #1 (Debian)) id 1BLTmY-0006GE-00 for ; Wed, 05 May 2004 17:18:22 -0400 Date: Wed, 5 May 2004 17:18:22 -0400 From: Manos Renieris To: caml-list@inria.fr Subject: [Caml-list] Total application of function with labels Message-ID: <20040505211822.GA23376@cs.brown.edu> Reply-To: Manos Renieris Mail-Followup-To: caml-list@inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-Miltered: at concorde with ID 40995A1E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; renieris:01 bug:01 passing:01 bug:01 labeling:01 int:01 int:01 labels:01 labels:01 enforce:02 arguments:03 arguments:03 let:04 let:04 functions:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Total applications of functions with labeled arguments will work, even if the actual arguments have no labels. So if you call let my_a = ... in let my_b = ... in f my_b my_a it doesn't matter whether you declared let f (a:int) (b:int) = a * (b + 1);; or let f ~(a:int) ~(b:int) = a * (b + 1);; and none will save you from the bug of passing the arguments in the wrong order. A bug like this cost me a few nights of sleep a while ago. Is there a programming convention that would "enforce" labeling the arguments in a total application of a certain function? Thanks, -- Manos ------------------- 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