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.0 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 8B6EFBB84 for ; Thu, 11 Sep 2008 14:16:25 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEANqoyEhREHR+/2dsb2JhbAC4RoFkgzg X-IronPort-AV: E=Sophos;i="4.32,379,1217800800"; d="scan'208";a="16829760" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 11 Sep 2008 14:16:25 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m8BCGOx9018805 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 11 Sep 2008 14:16:25 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEANqoyEhREHR+/2dsb2JhbAC4RoFkgzg X-IronPort-AV: E=Sophos;i="4.32,379,1217800800"; d="scan'208";a="16829758" Received: from unknown (HELO office.stork.ru) ([81.16.116.126]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 11 Sep 2008 14:16:24 +0200 Received: from [192.168.21.130] (serp [192.168.21.130]) by office.stork.ru (8.13.5/8.13.5) with ESMTP id m8BCG1ND010030; Thu, 11 Sep 2008 16:16:07 +0400 Subject: Re: [Caml-list] Camlp4. print variable value to target source. From: =?UTF-8?Q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9_?= =?UTF-8?Q?=D0=9F=D0=BB=D0=B0=D0=BA=D1=81=D0=B8=D0=BD?= To: Jeremy Yallop Cc: Caml List In-Reply-To: <20080911130028.12z0ml44ysg84k8k@www.sms.ed.ac.uk> References: <1221128186.15737.10.camel@serphost.localdomain> <20080911130028.12z0ml44ysg84k8k@www.sms.ed.ac.uk> Content-Type: text/plain Date: Thu, 11 Sep 2008 16:15:59 +0400 Message-Id: <1221135359.15737.22.camel@serphost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 48C90C18.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 0100,:01 ctyp:01 expr:01 ctyp:01 mtype:01 lident:01 ctype:01 expr:01 W12:98 W14:98 wrote:01 parsing:01 caml-list:01 int:01 On Thu, 2008-09-11 at 13:00 +0100, Jeremy Yallop wrote: > Quoting ?????? ??????? : > > Exitst any way to do such things? > > > > ------ > > let t = <:ctyp> in > > <:str_item> > > I think that you're looking for this: > > let t = <:expr< <:ctyp> >> in > <:str_item> > > although I'm curious as to why. > > Jeremy. > The problem what t variable result of parsing EXTEND Gram str_item: [ [ "mtype" ; n = a_LIDENT ; "=" ; t = ctype -> <:expr< let f = <:expr<$t$>> >> ] END And result now is: let f = t But i need to: let f = Ast.TyId (_loc, Ast.IdLid (_loc, "int"))