Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] kprintf
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Christophe Delage <cdelage@e...>
Subject: [Caml-list] kprintf
Hi,
     I saw that this function has just been added to ocaml,
I think this is a good idea, but I am wondering why
the continuation function should return a string.
I wrote once, for my programs, a "kprintf-like" function
with _exactly_ the same code (there is not much difference between
sprintf and kprintf ;-), but I forced the type :

 mykprintf : (string -> 'b) -> ('a, string -> 'b, 'b) format -> 'a

and (as far as I know) there were no problems,

 mykprintf f fmt a1 .. an

seems to do the same thing (and have the same type) as

 f (mykprintf fmt a1 .. an)

whatever the return type of f is.

I saw a post in the list about "technical reasons",
could somebody be more precise ?

-Christophe

-------------------
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