Why is D unpopular, redux.

Walter Bright newshound2 at digitalmars.com
Tue May 24 05:00:14 UTC 2022


On 5/22/2022 3:37 AM, Timon Gehr wrote:
>>> Just on type qualifiers:
>>>   - Transitivity of type qualifier doesn't play nice with template. There is 
>>> no way to tell the compiler that a `const Tpl!T` actually is a `const 
>>> Tpl!(const T)`. As a result, no container library is possible and ranges have 
>>> serious problem when it come to qualifiers too.
>>
>> This needs a lot more fleshing out about what exactly is wrong and why.
>> ...
> 
> Instances of the same struct/class template are independent types without any 
> relationship. Different types of slices (for example) are not.

Illuminating examples, please.


> There is no way to declare a tail-immutable class reference.
> 
> immutable(int)* <- can rebind the reference, can't assign to value
> 
> immutable(Class) <- can't rebind the reference
> Class <- can rebind the reference, can assign to value

Should file an Enhancement Request on Bugzilla.


More information about the Digitalmars-d mailing list