Does D have too many features?

Timon Gehr timon.gehr at gmx.ch
Sun Apr 29 15:08:29 PDT 2012


On 04/29/2012 10:59 PM, Alex Rønne Petersen wrote:
> On 29-04-2012 14:26, David Nadlinger wrote:
>> - Unsigned right shift, but I can see how it can be useful (simply
>> underused?).
>
> It's clear that arithmetic right shift is what the programmer usually
> wants, and yet, we use >> to denote what they don't want. It's
> completely counter-intuitive.
>
> So, +1.
>

'>>' is arithmetic right shift.

>>
>> - shared: TLS by default is great, but only __gshared is really usable
>> right now. IMHO, shared had better been reserved for a comprehensive
>> take on the subject, rather than the half-baked implementation we have
>> right now.
>>
>> David
>
> It's clear that shared is biased towards heavily templatized code.
> It's not useful in non-templatized code because such code can't accept both
> shared and non-shared values.

Just cast it away if you do eg. locking. There is nothing wrong with it.
Code that operates on both (actually) shared and unshared data should be 
uncommon anyway.

>
> shared looks neat in theory, but is a fallacy in practice.
>

unshared is what is important. There is no unshared if there is no shared.


More information about the Digitalmars-d mailing list