C++ Logo


Advanced search

Re: Fwd: Internal fill *not* considered harmful (re: P1652)

From: Matthew Woehlke <mwoehlke.floss_at_[hidden]>
Date: Tue, 25 Jun 2019 19:07:52 -0400
On 25/06/2019 18.36, Victor Zverovich wrote:
>> How does one readily achieve this?
> While it is possible to achieve such formatting with moderate efforts
> without `=`, the main question is whether it's actually useful. [...]

As I already said in my other reply to Z.Y.... if you want to argue that
align==internal is useless, then fine; argue that. But argue *that*.
Don't argue that it should be removed because someone (yes, even if
"someone" was the specification of <format> itself) used it incorrectly.
(Unless you're arguing that it should be removed because it is
*impossible* to remove correctly, but I will claim to have rebutted that.)

That said, I admit to being curious how it survived 9 revisions if no
one considers it useful...

>> I'm not sure I agree that's broken.
> The reason why I think it's broken is that `0x 4` is not a valid number

...where by "valid" you really mean "can be *trivially* converted back
to a number by code", not "can be read by a human".

> which is not a great feature for something that tries to only format
> numbers.

...but it did what you asked it to do. {0<6} and {0>+6} don't produce
valid numbers (or the *same* number, at least) either. There are plenty
of ways to get <format> to produce something that won't round-trip;
that's not a defect. It's only a defect if formats that *ought* to
produce a string that can be read back (e.g. as in P1652) fail to do so.

IMHO expecting all outputs to be machine readable is "not a great"
requirement for a feature that exists to make numbers pretty for *human*
consumption. The set of presentations which are easy for humans to read
does not need to be — nor should we *expect* it to be, IMHO — a strict
subset of the set of presentations which are easy for computers to read.

Again, if you want to chuck align==internal on the grounds that "no one
needs it" (especially if this doesn't result in any changes that would
preclude introducing it in the future), I'm okay with that. My objection
is to the non-sequitur assertion that the wrong behavior of arithmetic
zero-padding requires doing so.


Received on 2019-06-25 18:09:44