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 CAA26238; Fri, 28 Mar 2003 02:14:42 +0100 (MET) 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 CAA26368 for ; Fri, 28 Mar 2003 02:14:41 +0100 (MET) 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 h2S1EeX21544 for ; Fri, 28 Mar 2003 02:14:40 +0100 (MET) Received: (qmail 76425 invoked from network); 28 Mar 2003 01:14:39 -0000 Received: from arda.pair.com (HELO compaqreview.d6.com) (209.68.1.133) by relay.pair.com with SMTP; 28 Mar 2003 01:14:39 -0000 X-pair-Authenticated: 209.68.1.133 Message-Id: <4.3.2.7.2.20030327170847.04102fc0@localhost> X-Sender: checker@localhost X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Date: Thu, 27 Mar 2003 17:10:07 -0800 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.20030327170154.04599ef8@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam: no; 0.00; hecker:01 checker:01 caml-list:01 val:01 bug:01 faq:01 beginner's:01 beginners:01 bin:01 chris:01 caml-bugs:01 ocaml:01 caml:01 groups:01 syntax:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Before someone comments that the optional argument is an 'a option and not an 'a, what I really wanted to do is this: # let f ?(((x,y) as xy) = 0.0,0.0) () = xy;; Characters 8-9: let f ?(((x,y) as xy) = 0.0,0.0) () = xy;; ^ Syntax error Which also doesn't work but there's no 'a option involved, so it "should". I was trying to create the shortest example but took it a bit too far. Chris At 17:05 3/27/2003 -0800, Chris Hecker wrote: >Is there a way to name the components of an optional argument? > ># let f ((x,y) as xy) = xy;; >val f : 'a * 'b -> 'a * 'b = ># let f ?xy () = xy;; >val f : ?xy:'a -> unit -> 'a option = ># let f ?((x,y) as xy) () = xy;; >Characters 8-9: > let f ?((x,y) as xy) () = xy;; > ^ >Syntax error > >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