Herb Sutter's CppCon talk "Extending and Simplifying C++: Thoughts on Pattern Matching using `is` and `as`"

Walter Bright newshound2 at digitalmars.com
Mon Nov 1 21:41:29 UTC 2021


On 11/1/2021 9:18 AM, deadalnix wrote:
> This part IMO, point at what the #1 problem with the way things have been done 
> in D. D's feature just don't compose well because they aren't orthogonal with 
> each other (and many are inconsistent).

Can you be more specific?

Some examples of consistency in D:

1. basic types, structs, and arrays are interchangeable. But I couldn't add 
tuples to the list, because the function call ABI for structs is "special". Urgh.

2. The nature of how const, immmutable, and shared are applied to types is 
completely consistent, despite many requests to change that.

4. The way scope & return & ref apply to types is completely consistent. This 
enables me to advise that when people have problems understanding it, to rewrite 
their example code in terms of raw pointers, as it will behave the same.

A counter-example:

The original symbol lookup mechanism was completely consistent. It behaved 
exactly the same way for all scoped declarations.

However, I was the only one who felt that way. I was never even able to get 
anyone to even *concede* that it was consistent, but they didn't like it that 
way. What we have today is special case two-pass lookup, with special handling 
for imports.


More information about the Digitalmars-d mailing list