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
[Caml-list] kprintf
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-08-15 (14:52)
From: Christophe Delage <cdelage@e...>
Subject: [Caml-list] kprintf
     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 ?


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