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.1 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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 5106FBC69 for ; Thu, 12 Apr 2007 09:06:24 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.225]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3C76NwB011239 for ; Thu, 12 Apr 2007 09:06:23 +0200 Received: by nz-out-0506.google.com with SMTP id l8so370929nzf for ; Thu, 12 Apr 2007 00:06:23 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JWVqL4RQ57R0zhbiwBOu4tZKiGOa6lQ1LRZlQTDfsPin+n/v5Lg3igzqIuv8DedL+QQqfuMSPnBQlJw+eUmy6uRnAcaFzpE+8ZCoomzZhdNVhUGY83jOTE5HSa3GsL5FSJqtHVWKQL/JmDBhZE+TXXBK6kkhwObX+jpnxNRV58M= 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=Gwh3ULSIq0QGSTIrZQLpZhFpW7TUkw/R7Y5ApWRGXMGaczEzGXsUfYLlAG+E/0sqAm+QKkWlr0pGFxkxuSYzZo68vdVqLlGK9W2MtOwTEBlndPf3V/4jOmsu1GodXChHu0K9LZfO+taerLDlOi+ZAmAkse8+6dNYSwRLGwhExzs= Received: by 10.114.14.1 with SMTP id 1mr636287wan.1176361582594; Thu, 12 Apr 2007 00:06:22 -0700 (PDT) Received: by 10.114.181.18 with HTTP; Thu, 12 Apr 2007 00:06:22 -0700 (PDT) Message-ID: Date: Thu, 12 Apr 2007 09:06:22 +0200 From: "Nicolas Pouillard" To: "Pietro Abate" , "ocaml ml" Subject: Re: [Caml-list] (old) camlp4 question In-Reply-To: <20070412012049.GA23847@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: <20070411105949.GA7707@pulp.rsise.anu.edu.au> <20070412012049.GA23847@pulp.rsise.anu.edu.au> X-j-chkmail-Score: MSGID : 461DDA6F.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 461DDA6F.000 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 surrounded:98 wrote:01 wrote:01 caml-list:01 parentheses:01 int:01 int:01 On 4/12/07, Pietro Abate wrote: > 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). ?? is for constraints on type parameters (you can leave it empty) > 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 . Hum I see it's the type application that is like any other application in revised. int list -> list int (string, int) table -> table string int <:ctyp< (b 'b int as 'b) >> Regards, -- Nicolas Pouillard