missing HexString documentation

Seb seb at wilzba.ch
Wed Feb 7 16:51:02 UTC 2018


On Wednesday, 7 February 2018 at 16:03:36 UTC, Steven 
Schveighoffer wrote:
> On 2/7/18 10:41 AM, 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
>>>
>> 
>> They are deprecated:
>> 
>> https://dlang.org/changelog/pending.html#hexstrings
>> https://dlang.org/deprecate.html#Hexstring%20literals
>
> Wow, that's... a little superfluous.
>
> So we support this:
>
> "\xde\xad\xbe\xef"
>
> but not this?
>
> x"deadbeef"
>
> Seems like the same code you would need to parse the first is 
> reusable for the second, no? I don't see why this deprecation 
> was necessary, and now we have more library/template baggage.
>
> -Steve

For the same reason why octal literals have been deprecated years 
ago:

https://dlang.org/deprecate.html#Octal%20literals

The library solution works as well and it's one of the features 
that are rarely used and add up to the steep learning curve.


More information about the Digitalmars-d mailing list