Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Camlp4: varargs ie a la Printf
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alain Frisch <frisch@c...>
Subject: Re: [Caml-list] Camlp4: varargs ie a la Printf
On Mon, 17 Jun 2002, Basile STARYNKEVITCH wrote:

> My problem is to produce a quotation of a list of expressions (and not
> a quotation of a list expression). What should I put in place of the
> comment WHAT SHOULD BE ADDED HERE?   trace FOO "i=%d x=%g" i x end

I'm not sure to understand how this is more difficult than the solution
with Printf.kprintf; in both case, you want to generate a 'varargs'
application, right ?  Or what is a "list of expressions" ?

Try something like:

List.fold_left (fun e_1 e_2 -> <:expr< $e_1$ $e_2$ >>)


-- Alain

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners