[Issue 15227] std.format undocumented grammar

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Nov 7 20:51:42 PST 2015


https://issues.dlang.org/show_bug.cgi?id=15227

--- Comment #3 from Doug Nickerson <Tachyon165 at gmail.com> ---
In addition to the undocumented syntax I've further noticed:
- grammar for 'Integer' technically allows leading 0's and disallows negative
integers
- 'Integer' is used in the grammar for both non-negative (Position) and
negative (Width, Precision) purposes
- the 'r' (raw) and 'u' (unsigned) format spec characters are not documented
anywhere (neither in the grammar or the rest of the text)

That last bullet is probably more important than any other.

Caveat on the original issue: there is indeed a hyperlink very early on in the
formattedWrite documentation, which goes to an external page that does explain
the positional syntax/semantics: "%n$" and "*m$" but not the forms involving
':'

Incidentally, that page (2004 edition) indicates a newer version is available:
http://pubs.opengroup.org/onlinepubs/9699919799/  (2013 edition).  However, it
doesn't appear to have anything new regarding positional notation.

Related question: is there a reason, or should std.format support the 'i', 'p',
or 'n' format spec characters from the *printf family of functions?

--


More information about the Digitalmars-d-bugs mailing list