|
Boost : |
From: Darin Adler (darin_at_[hidden])
Date: 2002-01-28 10:52:16
On 1/28/02 7:36 AM, "Brey, Edward D" <EdwardDBrey_at_[hidden]> wrote:
> I've been putting some thought into the syntax of Boost.Format, and have
> come to see that the best syntax going forward is one that does not try to
> retain compatibility with printf as a high priority.
I don't agree with this premise.
While I think it might be useful to pursue a string-formatting library that
doesn't have printf compatibility, I do think that a library that provides
printf compatibility is quite useful, and is nearly accomplished with the
proposed format library. That is the reason I propose removing the "%1" from
the library and retaining only the "%1$s" form. I don't think that the
precedence problem with operator % is severe.
For what it's worth, where printf compatibility is not an issue in my
programs, I use a formatting system with a syntax like this:
"There's no space left on the disk named <disk>."
I find that the named parameters are easier to understand for translators
than numbered ones would be. And I don't try to create a terse C++ syntax
for this. I find that a normal sequence of function calls is just fine.
If we are going for something along the lines of:
"There's no space left on the disk named %1."
then I prefer Ed's proposal using [1] to anything else I've seen.
-- Darin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk