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 TAA26869; Fri, 9 May 2003 19:12:21 +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 TAA26864 for ; Fri, 9 May 2003 19:12:20 +0200 (MET DST) Received: from mail.exomi.com (mail.exomi.com [217.169.64.72]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h49HCJT24422 for ; Fri, 9 May 2003 19:12:19 +0200 (MET DST) Received: from exomi.com (unknown [10.0.5.5]) by mail.exomi.com (Postfix) with ESMTP id 8AE285EB7; Fri, 9 May 2003 20:12:18 +0300 (EEST) Date: Fri, 9 May 2003 20:12:17 +0300 Subject: Re: [Caml-list] Sumtypes of records Content-Type: text/plain; charset=ISO-8859-1; format=flowed Mime-Version: 1.0 (Apple Message framework v552) Cc: To: "Christophe Poucet" From: Ville-Pertti Keinonen In-Reply-To: <003e01c31645$2bfa3c00$e50e76d5@j> Message-Id: <62B8AA7D-8241-11D7-A0A9-000393863F70@exomi.com> Content-Transfer-Encoding: quoted-printable X-Mailer: Apple Mail (2.552) X-Spam: no; 0.00; caml-list:01 stupid:01 plop:01 foo:01 int:01 constructors:01 age:96 probably:05 pattern:06 type:07 tuple:07 matching:08 printable:10 sense:12 record:15 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Why can't constructors of sumtypes take nameless records? (Warning=20 > stupid example follows) > =A0 > type plop =3D Foo |=A0Bar {age : int};; ... Probably because it wouldn't make much sense. Either the only way you=20= could access age in the above is by matching Bar { age =3D x }, which is=20= not very useful (you might as well have Bar of int, or a tuple for=20 multiple fields), or the record type needs to have a name so that x in=20= the pattern Bar x has some printable type. ------------------- 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