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 SAA06426 for caml-redistribution; Mon, 15 Feb 1999 18:26:45 +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 LAA22742 for ; Mon, 15 Feb 1999 11:30:34 +0100 (MET) Received: from mail4.microsoft.com (mail4.microsoft.com [131.107.3.122]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id LAA01177 for ; Mon, 15 Feb 1999 11:30:32 +0100 (MET) Received: by mail4.microsoft.com with Internet Mail Service (5.5.2524.0) id <15AVFM57>; Mon, 15 Feb 1999 02:30:33 -0800 Message-ID: <39ADCF833E74D111A2D700805F1951EF0F00B9B3@RED-MSG-06> From: Don Syme To: "'Christopher Jeris'" , caml-list@inria.fr Subject: RE: anonymous record types in variants Date: Mon, 15 Feb 1999 02:30:23 -0800 X-Mailer: Internet Mail Service (5.5.2524.0) Sender: weis 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 >