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 UAA17240; Wed, 4 Apr 2001 20:26:58 +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 UAA17354 for ; Wed, 4 Apr 2001 20:26:57 +0200 (MET DST) Received: from mta6.snfc21.pbi.net (mta6.snfc21.pbi.net [206.13.28.240]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f34IQtH08527 for ; Wed, 4 Apr 2001 20:26:56 +0200 (MET DST) Received: from checkerlap.d6.com ([64.163.212.241]) by mta6.snfc21.pbi.net (Sun Internet Mail Server sims.3.5.2000.01.05.12.18.p9) with ESMTP id <0GB900EUMLDNJZ@mta6.snfc21.pbi.net> for caml-list@inria.fr; Wed, 4 Apr 2001 04:03:23 -0700 (PDT) Date: Wed, 04 Apr 2001 04:04:41 -0700 From: Chris Hecker Subject: [Caml-list] variant with tuple arg in pattern match? X-Sender: def6@shell16.ba.best.com To: caml-list@inria.fr Message-id: <4.3.2.7.2.20010404034802.0334fae0@shell16.ba.best.com> MIME-version: 1.0 X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Content-type: text/plain; charset="us-ascii" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I can't find anything about this in the docs, faq, or list archives. I expected ii to be bound to the int * int tuple (1,2) in this pattern match: # type foo = Foo of int * int;; type foo = Foo of int * int # match Foo (1,2) with Foo ii -> ii ;; Characters 23-29: The constructor Foo expects 2 argument(s), but is here applied to 1 argument(s) This works: # match Foo (1,2) with Foo _ -> () ;; - : unit = () But I can't get an "as" clause to work, either: # match Foo (1,2) with Foo ((_,_) as ii) -> ii ;; Characters 21-38: The constructor Foo expects 2 argument(s), but is here applied to 1 argument(s) But, even if the "as" worked, it's messy compared to the top method. Chris ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr