From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA19102; Wed, 26 Jun 2002 18:32:00 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA19016 for ; Wed, 26 Jun 2002 18:31:59 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g5QGVxn13104 for ; Wed, 26 Jun 2002 18:31:59 +0200 (MET DST) Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id SAA0000026929; Wed, 26 Jun 2002 18:31:58 +0200 (MET DST) Date: Wed, 26 Jun 2002 18:31:58 +0200 (MET DST) From: Damien Doligez Message-Id: <200206261631.SAA0000026929@beaune.inria.fr> To: caml-list@inria.fr, warplayer@free.fr Subject: Re: [Caml-list] printf hook Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >From: "Nicolas Cannasse" > >let sprint msg = > print_endline ("BEGIN: "^(sprintf msg)) > >without of course loosing the ability of having variable number of >parameters in my "msg". If you can wait for 3.05, or if you are willing to use the CVS version, you'll be able to write: let sprint fmt = let do_output s = print_endline ("BEGIN: " ^ s); "" in Printf.kprintf do_output fmt ;; The tail-call to kprintf allows it to get the extra arguments thanks to currying. The do_output function must return a string (which is returned by sprint) for technical reasons. (This may change before the release.) -- Damien ------------------- 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