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 BAA17984; Thu, 6 May 2004 01:16:50 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA17870 for ; Thu, 6 May 2004 01:16:48 +0200 (MET DST) Received: from mxout6.cac.washington.edu (mxout6.cac.washington.edu [140.142.33.20]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i45NGjEV000459 for ; Thu, 6 May 2004 01:16:47 +0200 Received: from mailhost1.u.washington.edu (mailhost1.u.washington.edu [140.142.32.141]) by mxout6.cac.washington.edu (8.12.11+UW04.02/8.12.11+UW04.03) with ESMTP id i45NGdEo000652 for ; Wed, 5 May 2004 16:16:43 -0700 Received: from lulu (mobile258.dyn.cs.washington.edu [128.208.7.79]) by mailhost1.u.washington.edu (8.12.11+UW04.02/8.12.11+UW04.03) with ESMTP id i45NGdnK001816 for ; Wed, 5 May 2004 16:16:39 -0700 Received: from martine by lulu with local (masqmail 0.2.20) id 1BLVcM-8G9-00 for ; Wed, 05 May 2004 16:15:58 -0700 Date: Wed, 5 May 2004 16:15:58 -0700 From: Evan Martin To: caml-list@inria.fr Subject: Re: [Caml-list] Total application of function with labels Message-ID: <20040505231558.GB31670@lulu> References: <20040505211822.GA23376@cs.brown.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040505211822.GA23376@cs.brown.edu> User-Agent: Mutt/1.5.5.1+cvs20040105i X-Miltered: at nez-perce with ID 409975DD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; evan:01 caml-list:01 2004:99 0400,:01 renieris:01 labeling:01 val:01 val:01 avoided:01 evan:01 caml:01 05,:01 int:01 int:01 labels:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, May 05, 2004 at 05:18:22PM -0400, Manos Renieris wrote: > Is there a programming convention that would "enforce" labeling the > arguments in a total application of a certain function? # type withlabels = WithLabels;; type withlabels = WithLabels # let withlabels = WithLabels;; val withlabels : withlabels = WithLabels # let f ~a ~b ?(withlabels : withlabels option) = a + b;; Warning: This optional argument cannot be erased val f : a:int -> b:int -> ?withlabels:withlabels -> int = # f 2 3 ~withlabels;; Expecting function has type a:int -> b:int -> int This argument cannot be applied without label This includes the ... includes the "optional argument cannot be erased warning", which can be avoided at the cost of making the code even weirder. http://caml.inria.fr/archives/200211/msg00176.html discusses this a bit, but I'm not quite sure I understand it. :\ -- Evan Martin martine@danga.com http://neugierig.org ------------------- 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