std.digest toHexString

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Mar 20 14:04:30 PDT 2017


On 03/20/2017 09:31 AM, Adam D. Ruppe wrote:
> On Monday, 20 March 2017 at 16:04:10 UTC, Kagamin wrote:
>> https://dpaste.dzfl.pl/eafa86c5426d
>
> Unbelievable, we're both right, sort of.
>
> So it is true that typeof(static[]) == dynamic.
>
> But the language also allows implicit conversion in the other
> direction.... WTF. If you put a variable in between, it will do a
> runtime array copy with assert(sizes match), and if the compiler can
> keep track of where it came from, it will implicitly just make it happen.
>
> So we explicitly sliced... then the compiler implicitly undid it again
> for overload selection since it knew the size.
>
> This might be the most messed up part of the D language to me now.

Agreed. Surprisingly, there are quite a number of issues that request 
exactly that, mostly thanks to our old friend bearophile. The following 
may be the reason for this WAT:

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

Ali



More information about the Digitalmars-d-learn mailing list