From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA16583 for caml-redistribution; Tue, 16 Feb 1999 08:22:24 +0100 (MET) 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 TAA19923 for ; Mon, 15 Feb 1999 19:03:49 +0100 (MET) Received: from mail3.microsoft.com (mail3.microsoft.com [131.107.3.123]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id TAA10176 for ; Mon, 15 Feb 1999 19:03:47 +0100 (MET) Received: by mail3.microsoft.com with Internet Mail Service (5.5.2524.0) id <15A6VCN2>; Mon, 15 Feb 1999 10:03:46 -0800 Message-ID: <25983782061AD111B0800000F86310FE1026CB04@RED-MSG-42> From: Manuel Fahndrich To: caml-list@inria.fr Subject: RE: anonymous record types in variants Date: Mon, 15 Feb 1999 10:03:39 -0800 X-Mailer: Internet Mail Service (5.5.2524.0) Sender: weis I also find this the major annoying feature of CAML records. I frequently use variant datatypes with a number of fields. Without records, the field order matters and has to be remembered when creating and accessing such variants. Anonymous records would be ideal on variants, since they would not introduce the extra level of indirection that you get when you declare an explicit record type. -Manuel -----Original Message----- From: Don Syme [mailto:dsyme@microsoft.com] Sent: Monday, February 15, 1999 2:30 AM To: 'Christopher Jeris'; caml-list@inria.fr Subject: RE: anonymous record types in variants FTR, I've also had a few situations where it seemed most natural to write similar constructs, but I couldn't. Cheers, Don > > The argument of a variant type constructor cannot be an > anonymous record > type, i.e.: > > type foo = One of {one: int} | Two of {two: string} > > is rejected at the first {. Of course this is easy to work > around, just > give the record types names: > > type foo_one = {one: int} > type foo_two = {two: string} > type foo = One of foo_one | Two of foo_two > > But, just out of curiosity, is there a quick explanation of > why it is this > way? > > thanks & peace, > > Chris Jeris MIT math grad student and novice OCaml music programmer >