Thread overview
D Idioms
Oct 02, 2020
data pulverizer
Oct 02, 2020
Guillaume Piolat
Oct 02, 2020
H. S. Teoh
Oct 02, 2020
Patrick Schluter
Oct 03, 2020
sarn
Oct 02, 2020
Ferhat Kurtulmuş
Oct 07, 2020
James Lu
September 30, 2020
D Idioms should be in this menu : ( screen )
https://github.com/vitalfadeev/dg2d-improve/raw/master/d-idioms.png

D Idioms : https://p0nce.github.io/d-idioms/

October 02, 2020
On Wednesday, 30 September 2020 at 03:03:47 UTC, Виталий Фадеев wrote:
> D Idioms should be in this menu : ( screen )
> https://github.com/vitalfadeev/dg2d-improve/raw/master/d-idioms.png
>
> D Idioms : https://p0nce.github.io/d-idioms/

Wow, didn't know about this document. I get the feeling there are lots of things like this out there that are "low-key" resources for D. Thanks for posting it.
October 02, 2020
On Wednesday, 30 September 2020 at 03:03:47 UTC, Виталий Фадеев wrote:
> D Idioms should be in this menu : ( screen )
> https://github.com/vitalfadeev/dg2d-improve/raw/master/d-idioms.png
>
> D Idioms : https://p0nce.github.io/d-idioms/

It is a great resource, however, the template of the page feels like "this domain is for sale" to me somehow :D
October 02, 2020
On Friday, 2 October 2020 at 10:25:20 UTC, data pulverizer wrote:
>
> Wow, didn't know about this document. I get the feeling there are lots of things like this out there that are "low-key" resources for D. Thanks for posting it.

Thanks. Writing this documentation was helpful for learning D. Threre are a lot of other topics to explore.



For example, did you know that shifting an integer by more than 31 is Undefined Behaviour?


October 02, 2020
On Fri, Oct 02, 2020 at 03:12:01PM +0000, Guillaume Piolat via Digitalmars-d wrote: [...]
> For example, did you know that shifting an integer by more than 31 is Undefined Behaviour?

This is not surprising; even in C/C++ it's well-known to be UB.


T

-- 
The early bird gets the worm. Moral: ewww...
October 02, 2020
On Friday, 2 October 2020 at 15:22:37 UTC, H. S. Teoh wrote:
> On Fri, Oct 02, 2020 at 03:12:01PM +0000, Guillaume Piolat via Digitalmars-d wrote: [...]
>> For example, did you know that shifting an integer by more than 31 is Undefined Behaviour?
>
> This is not surprising; even in C/C++ it's well-known to be UB.
>
Yes, and the reason is due to the shift instruction in the CPU's. Some CPU's do the right thing like PowerPC and some do the wrong thing like x86. On x86 SHL instruction masks the shift number that is used, so

    uint x=1;
    x << 32

is equivalent to

    x << (32 & 0x1F)    // 0x3F in 64 bits mode

which is the same as

    x

and not 0 as

If the behaviour was fixed, the compiler would have to add a test in some implementations.


October 03, 2020
On Friday, 2 October 2020 at 10:25:20 UTC, data pulverizer wrote:
> On Wednesday, 30 September 2020 at 03:03:47 UTC, Виталий Фадеев wrote:
>> D Idioms should be in this menu : ( screen )
>> https://github.com/vitalfadeev/dg2d-improve/raw/master/d-idioms.png
>>
>> D Idioms : https://p0nce.github.io/d-idioms/
>
> Wow, didn't know about this document. I get the feeling there are lots of things like this out there that are "low-key" resources for D. Thanks for posting it.

There are some more good resources in here:
https://github.com/zhaopuming/awesome-d
October 07, 2020
On Wednesday, 30 September 2020 at 03:03:47 UTC, Виталий Фадеев wrote:
> D Idioms should be in this menu : ( screen )
> https://github.com/vitalfadeev/dg2d-improve/raw/master/d-idioms.png
>
> D Idioms : https://p0nce.github.io/d-idioms/


Send a pull request here https://github.com/dlang/dlang.org ?
October 07, 2020
On Wednesday, 7 October 2020 at 04:36:03 UTC, James Lu wrote:
> On Wednesday, 30 September 2020 at 03:03:47 UTC, Виталий Фадеев wrote:
>> D Idioms should be in this menu : ( screen )
>> https://github.com/vitalfadeev/dg2d-improve/raw/master/d-idioms.png
>>
>> D Idioms : https://p0nce.github.io/d-idioms/
>
>
> Send a pull request here https://github.com/dlang/dlang.org ?

this will be good