From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 61668BC0A for ; Sat, 17 Mar 2007 12:56:31 +0100 (CET) Received: from smtp5-g19.free.fr (smtp5-g19.free.fr [212.27.42.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2HBuVBw005389 for ; Sat, 17 Mar 2007 12:56:31 +0100 Received: from [192.168.1.222] (vil93-4-82-227-140-227.fbx.proxad.net [82.227.140.227]) by smtp5-g19.free.fr (Postfix) with ESMTP id D93F87E17; Sat, 17 Mar 2007 12:56:30 +0100 (CET) Message-ID: <45FBD76D.6050204@philippewang.info> Date: Sat, 17 Mar 2007 12:56:29 +0100 From: Philippe Wang User-Agent: Thunderbird 1.5.0.9 (Macintosh/20061207) MIME-Version: 1.0 To: Till Varoquaux Cc: ocaml ml Subject: Re: [Caml-list] Printf issues References: <9d3ec8300703161134o3866014bie47bf052b20b722@mail.gmail.com> In-Reply-To: <9d3ec8300703161134o3866014bie47bf052b20b722@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 45FBD76F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; printf:01 sprintf:01 printf:01 sprintf:01 cheers:01 wrote:01 typing:01 caml-list:01 output:02 string:02 string:02 unit:03 unit:03 channel:05 channel:05 Till Varoquaux wrote: > I having typing issues with sprintf: > > # Printf.sprintf "%a";; > - : (unit -> '_a -> string) -> '_a -> string = > > whereas: > > # Printf.printf "%a";; > - : (out_channel -> '_a -> unit) -> '_a -> unit = > > Am I missing something out here? If not why can't sprintf accept the > same printers as the other? Probably because it's not meant to be as you want it to be! Why should sprintf take a function to output something on a channel whereas it's used to return a string? ... Cheers, Philippe