From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA14812 for caml-redistribution; Tue, 19 Oct 1999 23:41:24 +0200 (MET DST) 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 VAA12448 for ; Tue, 19 Oct 1999 21:19:18 +0200 (MET DST) Received: from mail4.svr.pol.co.uk (mail4.svr.pol.co.uk [195.92.193.211]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id VAA07145 for ; Tue, 19 Oct 1999 21:19:17 +0200 (MET DST) Received: from [195.92.197.25] (helo=mail17.svr.pol.co.uk) by mail4.svr.pol.co.uk with esmtp (Exim 2.12 #2) id 11demv-0004YQ-00; Tue, 19 Oct 1999 20:19:13 +0100 Received: from modem-54.biscuit.dialup.pol.co.uk ([62.136.131.54] helo=toy.william.bogus) by mail17.svr.pol.co.uk with esmtp (Exim 2.12 #2) id 11dem5-0002sb-00; Tue, 19 Oct 1999 20:18:22 +0100 Received: (from williamc@localhost) by toy.william.bogus (8.8.7/8.8.7) id UAA14373; Tue, 19 Oct 1999 20:15:24 +0100 Date: Tue, 19 Oct 1999 20:15:24 +0100 Message-Id: <199910191915.UAA14373@toy.william.bogus> From: William Chesters MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Alain Frisch Cc: caml-list@inria.fr Subject: $0.02 suggestion for the Printf module In-Reply-To: References: X-Mailer: VM 6.34 under Emacs 20.2.1 Sender: weis Alain Frisch writes: > As I want to do it often, it would be useful to have a function : > > gen_printf: (string -> ()) -> ('a, Buffer.t, unit) format -> 'a > [or for performance (string -> ()) -> (char -> ()) -> ('a, ... ] > > taking as its first argument a 'printing function' You can do this with Format (and of course you get pretty-printing as well)---see Format.formatter_of_out_channel, etc. I don't know what the performance difference, if any, between Printf and Format is.