From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 5212DBC69 for ; Sun, 4 Mar 2007 13:08:10 +0100 (CET) Received: from mail.tepkom.ru (mail-ilca.tepkom.ru [82.179.167.5]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l24C89LO003031 for ; Sun, 4 Mar 2007 13:08:10 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.tepkom.ru (Postfix) with ESMTP id A0A15580C6F4; Sun, 4 Mar 2007 15:07:45 +0300 (MSK) X-Virus-Scanned: by amavisd-new-2.4.0 (20060403) (Debian) at tepkom.ru with clamav Received: from mail.tepkom.ru ([127.0.0.1]) by localhost (mail.tepkom.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6mWXmUtC5knl; Sun, 4 Mar 2007 15:07:45 +0300 (MSK) Received: from [192.168.1.2] (ppp91-122-1-9.pppoe.avangard-dsl.ru [91.122.1.9]) by mail.tepkom.ru (Postfix) with ESMTP id 67314580C6F1; Sun, 4 Mar 2007 15:07:45 +0300 (MSK) Message-ID: <45EAB6AB.1070809@tepkom.ru> Date: Sun, 04 Mar 2007 15:08:11 +0300 From: Dmitri Boulytchev User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: eliot@generation.net Cc: caml Subject: Re: [Caml-list] records with polymorphic variants? References: <45EA613F.3030104@generation.net> In-Reply-To: <45EA613F.3030104@generation.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 45EAB6A9.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; variants:01 syntax:01 foo:01 syntax:01 foo:01 beginner's:01 ocaml:01 bug:01 polymorphic:01 polymorphic:01 beginners:01 extensible:01 deprecated:01 caml-list:01 caml-list:01 Making type r polymorphic works fine: type 'a r = {x : 'a} let u = {x = `A 3} let v = {x = `B "test"} Best regards, Dmitry Boulytchev, St.Petersburg State University. > Hi, > > I'm trying to figure out how to define a record with a field whose > type is an extensible polymorphic variant. > > I can this: > > type f = [ `A of int ] > > type r = { x : f } > but then I can't do this: > > { x = `B "test" } > > I'm not even sure if what I'm asking for is possible. > > Guessing at the syntax I tried > > type r = { > f : [> #foo] > } > > which results in: > > Warning D: this syntax is deprecated. > f : [> #foo] > ^^^^ > Characters 24-28: > f : [> #foo] > ^^^^ > The type [< foo ] is not a polymorphic variant type > > I hope it is clear what I'm trying to do. Thanks for your help. > > -- eliot > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >