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=1.4 required=5.0 tests=DNS_FROM_RFC_POST autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 32D0BBC68 for ; Sun, 12 Nov 2006 01:46:54 +0100 (CET) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kAC0krwc021544 for ; Sun, 12 Nov 2006 01:46:53 +0100 Received: from db2.internal (db2.internal [10.202.2.12]) by frontend1.messagingengine.com (Postfix) with ESMTP id 20606DC2381; Sat, 11 Nov 2006 19:46:52 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by db2.internal (MEProxy); Sat, 11 Nov 2006 19:46:54 -0500 X-Sasl-enc: axPb6fDEnwYrqgZiOQiL2xue2jR3GQq/BCNlmCe3wCsX 1163292413 Received: from adsl-75-11-180-29.dsl.sndg02.sbcglobal.net (adsl-75-11-180-29.dsl.sndg02.sbcglobal.net [75.11.180.29]) by mail.messagingengine.com (Postfix) with ESMTP id 1198611060; Sat, 11 Nov 2006 19:46:46 -0500 (EST) Date: Sat, 11 Nov 2006 16:46:40 -0800 (PST) From: Martin Jambon X-X-Sender: martin@droopy To: Anastasia Gornostaeva Cc: Peter Gregory , caml-list@inria.fr Subject: Re: [Caml-list] printf and positional specifier In-Reply-To: <20061111214052.GA15424@ermine.home> Message-ID: References: <20061111201226.GA14282@ermine.home> <4556342C.10109@cis.strath.ac.uk> <45563D79.4070207@cis.strath.ac.uk> <20061111214052.GA15424@ermine.home> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-j-chkmail-Score: MSGID : 45566EFD.001 on concorde : j-chkmail score : XX : 0/20 2 X-Miltered: at concorde with ID 45566EFD.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; printf:01 specifier:01 specifies:01 gettext:01 gettext:01 syntax:01 frisch:01 1977:98 wrote:01 wrote:01 invert:01 caml-list:01 jambon:01 jambon:01 argument:02 On Sun, 12 Nov 2006, Anastasia Gornostaeva wrote: > On Sat, Nov 11, 2006 at 09:15:37PM +0000, Peter Gregory wrote: > >> I take a different reading to you Martin, although I think it is >> confusing. I believe that the number specified before the dollar sign >> is the argument that specifies the /precision/ of the output. >> >> So, it is not to specify the argument to print, but the argument to use >> as precision. That said, I tried it in the context they suggest and I >> couldn't make it work! >> >> Ermine: do you have a situation where this is important? I can't think >> of any situation that comes to mind. > > For example: > http://www.gnu.org/software/gettext/manual/html_mono/gettext.html#SEC18 > > In fact I have my own module for translations and i'm interesting in this > printf's feature. OK, so you really want to invert the order of the arguments :-) You might want to use a syntax extension like xstrp4 or heredoc. http://www.ocaml-programming.de/packages/documentation/xstrp4/ http://www.eleves.ens.fr/home/frisch/info/HereDoc.html Martin -- Martin Jambon, PhD http://martin.jambon.free.fr