weird formattedRead
Berni44
someone at somemail.com
Fri Apr 9 18:17:03 UTC 2021
On Friday, 9 April 2021 at 16:11:26 UTC, Oleg B wrote:
> valid '1/1/1': 0001-Jan-01 00:00:00 <<< see here
>
> [...]
>
> Is space a special char for `formattedRead` and it simple stop
> parse without throwing exception if not found space (that
> represented in fmt string)?
> Have `formattedRead` any other special chars?
> Or it's bug?
It's a (at least to me) known bug (I haven't taken the time to
report it yet; found it a few days ago, when I reworked the
docs). `formattedRead` treats space sometimes special and
sometimes not, which (obviously) may lead to strange behavior,
like it does here. If you like, you can [report this
one](https://issues.dlang.org/enter_bug.cgi); I'll probably will
care about it in a few weeks/months (I first want to fix the
`formattedWrite` bugs and finish implementing formatting floating
point numbers without calling `snprintf`.)
On Friday, 9 April 2021 at 16:39:30 UTC, Ali Çehreli wrote:
> P.S. I can't check whether the D standard library documentation
> includes that information because the documentation looks very
> different and very skimpy to me at this time. There is nothing
> on format characters on formattedRead's documentation. (?)
When using the `stable` docs you still should get, what you are
used to. But I guess, you used the `master` docs and looked at
`formattedWrite` where the information used to be.
Since about three weeks I'm on reworking completely the docs of
`std.format`. Before that, the module has been split in several
submodules (package, read, write, specs). Meanwhile I moved the
docs you know from `formattedWrite` to
[package](https://dlang.org/phobos-prerelease/std_format.html)
(but yet not reworked completely, because the review process
takes some time and I try to verify everything I state in the new
docs in the source code). For
[`formattedRead`](https://dlang.org/phobos-prerelease/std_format_read.html#.formattedRead) and [reading in general](https://dlang.org/phobos-prerelease/std_format_read.html), the new docs are already finished. Feedback is welcome.
More information about the Digitalmars-d-learn
mailing list