English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2007-09-03 (14:22)
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