Version française
Home     About     Download     Resources     Contact us    
Browse thread
polymorphic variants and camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: [Caml-list] polymorphic variants and camlp4
On Mon, 12 Feb 2007, Pietro Abate wrote:

> Hi all,
>
> What is the syntax to use polymorphic variants with camlp4 ?
>
> <:str_item< type a = A >> is ok, but <:str_item< type a = [ `A ] >>
> doesn't work as expected...
>
> While expanding quotation "str_item":
> Parse error: '=' or '>' or '<' or [a_list] or [constructor_declaration]
>  expected after '[' (in [type])
> Uncaught exception: Pcaml.Qerror("str_item", 1, _)

The syntax is:

   type a = [ = `A ]

(found it in pa_o.ml)

Martin

--
Martin Jambon
http://martin.jambon.free.fr