caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Thomas <david_hd@yahoo.com>
To: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] precision not working properly for strings in Printf?
Date: Mon, 2 Jul 2007 18:14:42 -0700 (PDT)	[thread overview]
Message-ID: <478853.23645.qm@web30501.mail.mud.yahoo.com> (raw)
In-Reply-To: <961FE40A-1574-4146-B9C2-DA56904E0939@valdosta.edu>

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/


  parent reply	other threads:[~2007-07-03  1:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-27  3:18 Quôc Peyrot
2007-06-27  3:38 ` [Caml-list] " Jonathan Bryant
2007-06-27  3:48   ` Quôc Peyrot
2007-06-27  4:11     ` Jonathan Bryant
2007-06-27  8:34       ` Vincent Hanquez
2007-06-27  9:53         ` Jonathan Bryant
2007-06-27 11:08           ` Quôc Peyrot
2007-07-03  1:14           ` David Thomas [this message]
2007-06-27 10:46         ` Quôc Peyrot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478853.23645.qm@web30501.mail.mud.yahoo.com \
    --to=david_hd@yahoo.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).