On Wednesday, 7 February 2018 at 15:41:37 UTC, Seb wrote:
On Wednesday, 7 February 2018 at 15:25:05 UTC, Steven
Schveighoffer wrote:
On 2/7/18 9:59 AM, Ralph Doncaster wrote:
It is mentioned in the literals section, but not documented:
https://dlang.org/spec/lex.html#string_literals
From reading forum posts I managed to figure out that
HexStrings are prefixed with an x. i.e. x"deadbeef"
Good catch! Even the grammar says nothing about what it is,
except it has HexString as a possible literal.
Can you file an issue? https://issues.dlang.org
-Steve
They are deprecated:
https://dlang.org/changelog/pending.html#hexstrings
https://dlang.org/deprecate.html#Hexstring%20literals
Hence, the grammar has been incompletely updated. As it's not
an error to use them now, it should have stated that they are
deprecated.
Anyhow, you can always go back in time:
https://docarchives.dlang.io/v2.078.0/spec/lex.html#HexString
Doesn't that go against the idea of -betterC, or will std.conv
work with -betterC.
p.s. contrary to what the deprecation notice says, hex strings
are very often used in crypto/hashing test cases. Most hash
specs have example hash strings to verify implementation code.