Replace core language HexStrings with library entity

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Mar 15 14:34:09 PDT 2015


On 3/15/2015 2:18 PM, Baz wrote:
> On Sunday, 15 March 2015 at 19:47:06 UTC, Walter Bright wrote:
>> HexStrings:
>>
>>     http://dlang.org/lex.html#HexString
>>
>> They're rarely used, but very useful when needed. But, as the octal literals
>> have shown, they can be easily replaced with a library template:
>>
>>     x"00 FBCD 32FD 0A"
>>
>> becomes:
>>
>>     hex!"00 FBCD 32FD 0A"
>>
>> Thoughts? Anyone want to write the hex template?
>
> I'd be interested. Here's a quick draft based on octal:
>
> http://dpaste.dzfl.pl/656a94cdfdba
>

I think you've got the right idea. Time for a pull request?

P.S. Also need to include all the examples in the dlang reference as unittest cases.


More information about the Digitalmars-d mailing list