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=2.8 required=5.0 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 2806BBC69 for ; Tue, 3 Jul 2007 03:14:44 +0200 (CEST) Received: from web30501.mail.mud.yahoo.com (web30501.mail.mud.yahoo.com [68.142.200.114]) by discorde.inria.fr (8.13.6/8.13.6) with SMTP id l631Ehfg005882 for ; Tue, 3 Jul 2007 03:14:43 +0200 Received: (qmail 23936 invoked by uid 60001); 3 Jul 2007 01:14:42 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=y0VgphxqcAO+W08pO2sinKofMl0otstGxj4NSK4XYgjTi1bM2M/GDVNLVJyQyuN49RB+JuaiHW/4/fpGLbSrzUO81f8ru+j85C8Bysrqh4mRh9zRHRqUw7I3FSKcZYWHiaHX4yNAxPrOaphHTFB1yG1maIfMqesvS1Fs1WmP528=; X-YMail-OSG: WqkHjpkVM1nVPW8jKlB3C9OEAUDglC9VNFsD5l_348rlyJgp6wfgVLtk31warFqHV4r4fmdq.1No4m23bacYocUM6A4uXiXXhAUOWJ1bxL9BR.yCFYHzZnx5FVBo3Q-- Received: from [141.212.108.229] by web30501.mail.mud.yahoo.com via HTTP; Mon, 02 Jul 2007 18:14:42 PDT Date: Mon, 2 Jul 2007 18:14:42 -0700 (PDT) From: David Thomas Subject: Re: [Caml-list] precision not working properly for strings in Printf? To: Caml List In-Reply-To: <961FE40A-1574-4146-B9C2-DA56904E0939@valdosta.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <478853.23645.qm@web30501.mail.mud.yahoo.com> X-Miltered: at discorde with ID 4689A303.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; printf:01 printf:01 incorrectly:01 bug:01 caml-list:01 strings:01 strings:01 motivation:02 failing:02 strong:96 sell:96 misleading:03 library:03 library:03 absent:04 While it is true that, theoretically, changing this to be in line with the C libraries has the potential to break existing code, I would stipulate that any code that would be broken by this change is already broken. My reasoning is as follows. The Printf format strings are intended to be intuitive to anyone who has worked with printf in C. This deviation, therefore, means that someone reading through code that says %.ns will reasonably but incorrectly come to a conclusion as to what that means. As there is a shorter way of expressing exactly the same thing, of greater clarity, in line with expectations, I would be quite surprised if any code does use %.ns to mean %ns, and I think that any such instances should be changed for the sake of clarity even absent any changes to the library. I conclude that, absent strong internal reasons for not doing so (and I have not looked at the implementation of the library, so I cannot speak to these), the behavior of %.ns should be declared a bug and brought in line with the C libraries. Failing this, it should be a warning/error to use %.ns as there is no motivation to do so, it is misleading when others consider the code, and it will more quickly inform the programmer that they cannot produce the desired effect in this manner. ____________________________________________________________________________________ Pinpoint customers who are looking for what you sell. http://searchmarketing.yahoo.com/