Version française
Home     About     Download     Resources     Contact us    
Browse thread
camlp4 3.10.0 and Camlp4.PreCast.Ast.ident in tuples
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: camlp4 3.10.0 and Camlp4.PreCast.Ast.ident in tuples
This code used to work in OCaml 3.09, but not in 3.10.  I don't really
understand what's going on, but I want to build a tuple here, so I'm
not sure how it could force me to use idents instead of exprs.

      let convert =
	(* Avoid generating a single-element tuple. *)
	match conversions with
	| [] -> <:expr< () >>
	| [a] -> <:expr< $a$ >>
	| conversions ->
	    <:expr< ( $list:conversions$ ) >> in   <---

      <:expr<
	let rows = $expr$ in
	let original_query = $str:query$ in
	List.map (
	  fun row ->
	    match row with
	      [ $list$ -> $convert$

File "pa_pgsql.ml4", line 335, characters 18-29:
This expression has type Camlp4.PreCast.Ast.expr list
but is here used with type Camlp4.PreCast.Ast.ident list

("conversions" is a list of expr.)

How is the Camlp4 3.10 manual progressing?

Rich.

-- 
Richard Jones
Red Hat