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 XAA02281; Mon, 11 Mar 2002 23:35:09 +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 XAA03073 for ; Mon, 11 Mar 2002 23:35:08 +0100 (MET) Received: from northwall.gnp.com (lsanca1-ar8-066-060.biz.dsl.gtei.net [4.35.66.60]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g2BMZ7100975 for ; Mon, 11 Mar 2002 23:35:07 +0100 (MET) Received: (from smap@localhost) by northwall.gnp.com (8.8.7/8.8.7) id OAA06329 for ; Mon, 11 Mar 2002 14:35:05 -0800 Received: from borealis.gnp.com(64.242.32.241) by northwall.gnp.com via smap (V2.1) id xma006327; Mon, 11 Mar 02 14:34:37 -0800 Received: by gnp.com (SMI-8.6/SMI-SVR4) id OAA17207; Mon, 11 Mar 2002 14:34:07 -0800 Received: from chimera(192.168.20.85) by polaris via smap (V2.1) id xma017191; Mon, 11 Mar 02 14:33:47 -0800 Message-ID: <3C8D30CA.C8CAAD91@gnp.com> Date: Mon, 11 Mar 2002 14:33:46 -0800 From: Jeff Polakow X-Mailer: Mozilla 4.7 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Caml-list] strange match error Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, I ran into a strange (I think) error and was wondering if someone out there can help me out. Why does the following program: type tt = A of string * int | B;; let f x = print_string ((fst x)^"\n");; let g x = match x with A y -> f y | B -> ();; produce the following response from ocaml? # #use "caml_test.ml";; type tt = A of string * int | B val f : string * 'a -> unit = File "caml_test.ml", line 3, characters 23-26: The constructor A expects 2 argument(s), but is here applied to 1 argument(s) Shouldn't the type reconstructor/checker realize that y is a pair? thanks, Jeff ------------------- 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