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 FAA32155; Mon, 28 Jul 2003 05:43:13 +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 FAA03810 for ; Mon, 28 Jul 2003 05:43:11 +0200 (MET DST) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id h6S3hAT09680 for ; Mon, 28 Jul 2003 05:43:11 +0200 (MET DST) Received: (qmail 80989 invoked from network); 28 Jul 2003 03:43:06 -0000 Received: from arda.pair.com (HELO checkerdell.d6.com) (209.68.1.133) by relay.pair.com with SMTP; 28 Jul 2003 03:43:06 -0000 X-pair-Authenticated: 209.68.1.133 Message-Id: <4.3.2.7.2.20030727203156.0240ddd0@localhost> X-Sender: checker@localhost X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Sun, 27 Jul 2003 20:41:57 -0700 To: caml-list@inria.fr From: Chris Hecker Subject: Re: [Caml-list] naming parts of optional arguments? In-Reply-To: <4.3.2.7.2.20030327180749.03282978@localhost> References: <8F4A019E-60BD-11D7-829E-000393BA7EBA@wetware.com> <4.3.2.7.2.20030327170847.04102fc0@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Loop: caml-list@inria.fr X-Spam: no; 0.00; hecker:01 checker:01 caml-list:01 val:01 woodyatt:01 bug:01 faq:01 beginner's:01 beginners:01 bin:01 chris:01 caml-bugs:01 ocaml:01 caml:01 blah:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk [old thread resurrected] Actually, I spoke too soon below, you have to have the "as xy" on there to be able to reference the tuple by xy. Doesn't that seem redundant given the ?xy: specification (which doesn't seem to be used)? # let f ?xy:((x,y)=(0,0)) () = x + y;; val f : ?xy:int * int -> unit -> int = # let f ?xy:((x,y)=(0,0)) () = xy;; Characters 29-31: let f ?xy:((x,y)=(0,0)) () = xy;; ^^ Unbound value xy # let f ?xy:((x,y) as xy =(0,0)) () = xy;; val f : ?xy:int * int -> unit -> int * int = # let f ?xy:((x,y) as blah =(0,0)) () = blah;; val f : ?xy:int * int -> unit -> int * int = # Chris At 18:11 3/27/2003 -0800, Chris Hecker wrote: >James replied off list, but I thought the others might like to see it: > >At 17:35 3/27/2003 -0800, james woodyatt wrote: >># let f ?xy:(x,y as xy = 0.0,0.0) () = xy;; >>val f : ?xy:float * float -> unit -> float * float = > >Ah, that's what I wanted, thanks! It looks like you can just do ?xy:(x,y >= 0,0) and skip the "as xy" too. Wacky syntax...it looks like I should >have looked in the pseudo-bnf before posting since it looks like this is >in there. > >Thanks, >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 ------------------- 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