[Issue 18599] New: std.format %(...%) format does not allow modifiers that take additional arguments
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Mar 12 16:31:07 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18599
Issue ID: 18599
Summary: std.format %(...%) format does not allow modifiers
that take additional arguments
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: hsteoh at quickfur.ath.cx
Currently, this is supported:
-----
import std.format;
format("%(%.14f, %)", [ 1.1, 2.2, 3.3 ]);
-----
and so is this:
-----
format("%(%10.3f, %)", [ 1.1, 2.2, 3.3 ]);
-----
However, this is not supported:
-----
format("%(%.*f, %)", double.dig, [ 1.1, 2.2, 3.3 ]);
-----
Nor this:
-----
format("%(%*.3f, %)", 5, [ 1.1, 2.2, 3.3 ]);
-----
Basically, any nested specifier that takes an additional argument is not
supported, because of the way nested specifiers are implemented.
It would be nice if this could somehow be made to work.
--
More information about the Digitalmars-d-bugs
mailing list