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 DAA26492; Fri, 15 Nov 2002 03:22:37 +0100 (MET) 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 DAA26497 for ; Fri, 15 Nov 2002 03:22:36 +0100 (MET) Received: from relay.pair.com (relay1.pair.com [209.68.1.20]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id gAF2MZX18159 for ; Fri, 15 Nov 2002 03:22:35 +0100 (MET) Received: (qmail 24439 invoked from network); 15 Nov 2002 02:22:33 -0000 Received: from arda.pair.com (HELO compaqreview.d6.com) (209.68.1.133) by relay1.pair.com with SMTP; 15 Nov 2002 02:22:33 -0000 X-pair-Authenticated: 209.68.1.133 Message-Id: <4.3.2.7.2.20021114181653.0420d2a0@localhost> X-Sender: checker@localhost X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Thu, 14 Nov 2002 18:21:56 -0800 To: Jacques Garrigue From: Chris Hecker Subject: Re: [Caml-list] labels and optional arguments in 3.06 Cc: caml-list@inria.fr In-Reply-To: <20021115100924V.garrigue@kurims.kyoto-u.ac.jp> References: <4.3.2.7.2.20021114102309.041f3dd8@localhost> <4.3.2.7.2.20021113204718.031fa750@localhost> <20021114172307R.garrigue@kurims.kyoto-u.ac.jp> <4.3.2.7.2.20021114102309.041f3dd8@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > I would restate this (to conveniently make it sound less radical/more > > radical in my favor :). If you are using labels primarily for > > documentation, but you rarely if ever apply them on calls, and then you > > want to use optional arguments, you are suddenly forced to always use > > labels on those calls. This could force you to label zillions of calls in > > your huge codebase when you add an optional argument to a label-documented > > function, but wait, that goes completely against the intent of optional > > arguments (that you don't know they're there unless you care)! Therefor, > > one is incented to not use labels at all. >Sorry, you're wrong. >The problem only appears when you actually want to pass an optional >argument. If you are adding this optional argument afterwards, this >will not disturb existing function calls that do not use this optional >argument. Labels may only be needed on new code. >No, really, you're making a big fuss for a tiny case. Oops, you're right, sorry about that! I actually typed the first complaint (forced to use labels when using optional argument), and then thought of the second point (spreading) afterwards, but I obviously didn't think it through (even my own experiments disproved that point :). The correct second point would just be that now calls with the optional argument look different from calls without, so it's not local, in some sense. But yes, that's a much less critical complaint. >On a different subject, there is a nice property in writing labels in >applications: this means that you can make these arguments optional >afterwards, without any need to change old code. While the type >checker allows you to ommit the labels, you then loose that property. Sure, but the thread is not about whether writing labels is good or bad in general (not a subject we want to ressurrect), it's just about the effect of optional labels on labeled functions. >That's exactly the problem: my "simple" (already complicated) >definition doesn't handle all cases. I guess I figured there'd be a "simple" generalization that was easier. Is the commuting property affecting the difficulty? I also don't care about that feature. :) But anyway, if it's not relatively easy, I'll just let it die. Chris ------------------- 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