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.2 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 8A4ACBC0A for ; Mon, 12 Feb 2007 11:54:18 +0100 (CET) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.235]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1CAsHxl004247 for ; Mon, 12 Feb 2007 11:54:18 +0100 Received: by nz-out-0506.google.com with SMTP id l8so1611820nzf for ; Mon, 12 Feb 2007 02:54:16 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XQ7U/H3YfZkV7914vGgL9lck40SegVjaZbWoZkut/Fo3C+JFJ22cQEYFpiSQxDL9g2VDWzdoZaQ4p8pfVAckDyCCsUtP8s8FHxSd4+LVwPu0ipSyl4cA16If0T+56nS4y+F/p/vv1CNaYZb96B9zQ4EccYh0skPiyKN2OaAPrd8= Received: by 10.35.125.16 with SMTP id c16mr33067950pyn.1171277656530; Mon, 12 Feb 2007 02:54:16 -0800 (PST) Received: by 10.35.72.18 with HTTP; Mon, 12 Feb 2007 02:54:15 -0800 (PST) Message-ID: Date: Mon, 12 Feb 2007 11:54:15 +0100 From: "Nicolas Pouillard" To: "Pietro Abate" , "ocaml ml" Subject: Re: [Caml-list] polymorphic variants and camlp4 In-Reply-To: <20070212033220.GA30365@pulp.rsise.anu.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070212033220.GA30365@pulp.rsise.anu.edu.au> X-j-chkmail-Score: MSGID : 45D04759.000 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 45D04759.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; variants:01 camlp:01 syntax:01 variants:01 camlp:01 syntax:01 polymorphic:01 polymorphic:01 wrote:01 caml-list:01 grammar:01 int:01 int:01 declaration:02 revised:02 On 2/12/07, Pietro Abate wrote: > Hi all, > > What is the syntax to use polymorphic variants with camlp4 ? It depends what you mean by "with camlp4", but I suppose you mean "what is the revised syntax for polymorphic variants ?". > <:str_item< type a = A >> is ok, but <:str_item< type a = [ `A ] >> <:str_item< type a = A >> is not really ok neither try <:str_item< type a = A | B >> to see that's not ok, the grammar just accept it as an alias. The syntax for classic variants is <:str_item< type a = [ A | B of int and int | C of (int * int) ] >> For polymorphic ones it's <:str_item< type a = [ = A | B ] >> > doesn't work as expected... Yes but you expected the original syntax for types declaration. -- Nicolas Pouillard