named arguments, string interpolation, please stop.

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Jan 11 23:04:34 UTC 2024


On 12/01/2024 11:56 AM, Timon Gehr wrote:
> On 1/11/24 23:37, Richard (Rikki) Andrew Cattermole wrote:
>> On 12/01/2024 11:33 AM, Timon Gehr wrote:
>>> If you do that D can no longer correctly implement a higher-order 
>>> function that forms the composed function from its two arguments. It 
>>> looks good on paper for a few minutes, but this is not a good 
>>> solution to apply by default.
>>
>> Unless we get something different that solves the same premise, opt-in 
>> is fine.
>>
>> I'm thinking explicitly for things like ``opApply``. Having giant 
>> mixin templates that handle all combinations is far worse.
> 
> Yes, attribute polymorphism is needed for that case, but currently there 
> is no way to abstract over attributes and this is invariably the point 
> where language features become a bit too esoteric for people (both 
> language designers and users) who are not type system experts and then 
> ad-hoc hacks proliferate.

I am very open to a counter proposal that covers the points you have 
outlined.

Right now, contract invalidation + finely grained template solution for 
when you need more control is the bar to beat, at least for me.

Either way, right now this problem is dividing the community and causing 
significant issues with attributes in practice. It needs solving. It 
would be a major pressure release for this subject for many people.



More information about the Digitalmars-d mailing list