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 SAA19771; Wed, 26 Jun 2002 18:47:43 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA19419 for ; Wed, 26 Jun 2002 18:47:41 +0200 (MET DST) Received: from mel-rto6.wanadoo.fr (smtp-out-6.wanadoo.fr [193.252.19.25]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g5QGlf511101; Wed, 26 Jun 2002 18:47:41 +0200 (MET DST) Received: from mel-rta10.wanadoo.fr (193.252.19.193) by mel-rto6.wanadoo.fr (6.5.007) id 3D186837000E99D5; Wed, 26 Jun 2002 18:47:41 +0200 Received: from warp (217.128.142.232) by mel-rta10.wanadoo.fr (6.5.007) id 3D11E5E500352C8B; Wed, 26 Jun 2002 18:47:41 +0200 Message-ID: <007b01c21d31$0993f650$a500a8c0@warp> From: "Nicolas Cannasse" To: "Damien Doligez" , References: <200206261631.SAA0000026929@beaune.inria.fr> Subject: Re: [Caml-list] printf hook Date: Wed, 26 Jun 2002 18:46:36 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > >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.) Seems nice :) I'll wait the official release of 3.05 before switching to kprintf. Thanks to all people who answered. Nicolas Cannasse ------------------- 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