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.2 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 09967BBAF for ; Thu, 26 Mar 2009 18:29:22 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8CALNYy0nCpx6vi2dsb2JhbACNFIhtAQEBCgsKGL42g3cG X-IronPort-AV: E=Sophos;i="4.38,426,1233529200"; d="scan'208";a="25048266" Received: from unknown (HELO ka.univ-orleans.fr) ([194.167.30.175]) by mail3-smtp-sop.national.inria.fr with ESMTP; 26 Mar 2009 18:29:21 +0100 Received: from smtps.univ-orleans.fr (localhost [127.0.0.1]) by ka.univ-orleans.fr (Postfix) with ESMTP id 867DE12AD53; Thu, 26 Mar 2009 18:29:19 +0100 (CET) Received: from [192.168.0.12] (ras75-4-82-235-58-110.fbx.proxad.net [82.235.58.110]) by smtps.univ-orleans.fr (Postfix) with ESMTP id 6EAB336E61; Thu, 26 Mar 2009 18:29:22 +0100 (CET) Subject: Re: [Caml-list] printf "%a" vs sprintf "%a" From: David Rajchenbach-Teller To: Tiphaine Turpin Cc: caml-list@yquem.inria.fr In-Reply-To: <49CBB2F4.6000000@irisa.fr> References: <49CBB2F4.6000000@irisa.fr> Content-Type: text/plain; charset=utf-8 Date: Thu, 26 Mar 2009 18:29:51 +0100 Message-Id: <1238088591.6241.17.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.12.1 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; printf:01 sprintf:01 ens-lyon:01 printf:01 sprintf:01 syntax:01 cheers:01 0100,:01 beginner's:01 ocaml:01 bug:01 univ-orleans:01 lifo:01 2009:98 beginners:01 Yeah, the behaviour of *printf is weird in this respect (and that of Extlib's printf is even a tad worse). For this reason, in Batteries Included, we have Printf.sprintf (which behaves as the base Printf.sprintf) and Printf.sprintf2 (which behaves as you expected) All of this in addition to our [Print] module, which offers a syntax comparable with [Printf], but allows extending the format rather than using %a and %t. Cheers, David On Thu, 2009-03-26 at 17:53 +0100, Tiphaine Turpin wrote: > Wouldn't it be simpler to have > two separate directives which accept respectively string printers and > channel printers, regardless of the outer printing function ? > > Tiphaine > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs -- David Teller-Rajchenbach Security of Distributed Systems http://www.univ-orleans.fr/lifo/Members/David.Teller « Ce matin Un crétin A tué un chercheur. » (air connu) Latest News of French Research: System being liquidated. Researchers angry.