Version franaise
Home About Download Resources Contact us
Browse thread
Camlp4. print variable value to target source.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Сергей_ Плаксин <serp@s...>
Subject: Re: [Caml-list] Camlp4. print variable value to target source.
On Thu, 2008-09-11 at 13:02 +0100, David Teller wrote:
> On Thu, 2008-09-11 at 14:16 +0400, Сергей Плаксин wrote:
> > Exitst any way to do such things?
> > 
> > ------
> >   let t = <:ctyp<int>> in
> >   <:str_item<let t = ?content of t here? >>
> > ----
> > ||
> > -----
> > let t = Ast.TyId (_loc, Ast.IdLid (_loc, "int"));
> > -----
> 
> That doesn't look correctly typed. However, you can try
> replacing ?contents of t here? with $t$.
> 
> Cheers,
>  David
> 

let t = <:ctyp<int>> in
<:str_item<let t = $t$ >>
=====

This expression has type
  Camlp4.PreCast.Syntax.Ast.ctyp = Camlp4.PreCast.Ast.ctyp
but is here used with type
  Camlp4.PreCast.Syntax.Ast.expr = Camlp4.PreCast.Ast.expr
Command exited with code 2.