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=0.1 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 0A662BC69 for ; Thu, 12 Apr 2007 03:20:59 +0200 (CEST) Received: from mail.rsise.anu.edu.au (mail.rsise.anu.edu.au [150.203.208.4]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3C1Kt8v031230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 12 Apr 2007 03:20:58 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id D130F545CD for ; Thu, 12 Apr 2007 11:20:50 +1000 (EST) Received: from mail.rsise.anu.edu.au ([150.203.208.4]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05617-01 for ; Thu, 12 Apr 2007 11:20:50 +1000 (EST) Received: from pulp.rsise.anu.edu.au (pulp.rsise.anu.edu.au [150.203.208.49]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id B6F7D545CA for ; Thu, 12 Apr 2007 11:20:50 +1000 (EST) Received: by pulp.rsise.anu.edu.au (Postfix, from userid 1560) id 26BC3A0AFC7; Thu, 12 Apr 2007 11:20:50 +1000 (EST) Date: Thu, 12 Apr 2007 11:20:49 +1000 From: Pietro Abate To: ocaml ml Subject: Re: [Caml-list] (old) camlp4 question Message-ID: <20070412012049.GA23847@pulp.rsise.anu.edu.au> Mail-Followup-To: Pietro Abate , ocaml ml References: <20070411105949.GA7707@pulp.rsise.anu.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Australian National University) User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mail.rsise.anu.edu.au X-Miltered: at discorde with ID 461D8977.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 0200,:01 sig:01 toplevel:01 bool:01 bool:01 ctyp:01 ctyp:01 recursive:01 surrounded:98 blog:98 blog:98 wrote:01 caml-list:01 parentheses:01 On Wed, Apr 11, 2007 at 01:43:48PM +0200, Nicolas Pouillard wrote: > Two things: > The `as' must be surrounded by parentheses (('b,int) b as 'b). > And a type declaration is not a type, you can use a str_item or a sig_item. > Here we go: <:str_item< type a = (b ($list:l$) as 'b) >>;; Doesn't quite work for me... This is my usage pattern. I've a toplevel <:str_item< type $list:l$ >> where l is a list of ((_loc * string),(string * (bool * bool)) list, ctyp ,?? list) and ?? list is a list of something that I haven't figure out yet (the manual says <:str_item< type $list:sslt$ >>: type declaration). to write type a = (b ($list:l$) as 'b) , I've to give a list l of one element as ((_loc,"a"),[], <:ctyp< (b ($list:[<:ctyp< 'b >>,<:ctyp< int >>]$) as 'b) >>, []) My problem is to write the type (('b,int) b as 'b) as a ctyp . I want to write it in this way as both l and the list of type variables in (('b,int) b as 'b) are not fixed. Moreover types in <:str_item< type $list:l$ >> can be mutually recursive. thanks :) p -- ++ Blog: http://blog.rsise.anu.edu.au/?q=pietro ++ ++ "All great truths begin as blasphemies." -George Bernard Shaw ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html