From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 5CECEBB81 for ; Thu, 12 Jan 2006 14:27:09 +0100 (CET) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0CDR9lm015498 for ; Thu, 12 Jan 2006 14:27:09 +0100 Received: from localhost.localdomain by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id OAA0000032092; Thu, 12 Jan 2006 14:27:08 +0100 (MET) Date: Thu, 12 Jan 2006 14:27:10 +0100 From: Virgile Prevosto To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Request for comments: Printf list conversion Message-ID: <20060112142710.3baabb9b@localhost.localdomain> In-Reply-To: <9A1DDF7A-B006-4DE7-B44D-7866F3D5D525@inria.fr> References: <43C61F1F.4030101@barettadeit.com> <17350.10156.454589.275252@gargle.gargle.HOWL> <9A1DDF7A-B006-4DE7-B44D-7866F3D5D525@inria.fr> X-Mailer: Sylpheed-Claws 1.9.100 (GTK+ 2.8.9; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce with ID 43C6592D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 printf:01 damien:01 filliatre:01 val:01 separators:01 printf:01 tutto:98 oggi:98 volta:98 wrote:01 doligez:01 element:02 guess:02 string:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Le jeu 12 jan 2006 13:55:56 CET, Damien Doligez a écrit: > On Jan 12, 2006, at 10:55, Jean-Christophe Filliatre wrote: > > > val print_list : > > ?sep:(formatter -> unit -> unit) -> > > (formatter -> 'a -> unit) -> formatter -> 'a list -> unit > > > Yuck. Isn't this type (formatter -> unit -> unit) isomorphic to string, > in the absence of side-effects? Or do you really need separators that > behave differently depending on the state of some reference? > With Format, yes: you may want to use the pretty-printing features of the module, and for instance add a break hint after each element of the list. For Printf, on the other hand, I guess that a string would be good enough -- E tutto per oggi, a la prossima volta Virgile