On type functions

Stefan Koch uplink.coder at googlemail.com
Wed May 6 14:40:37 UTC 2020


On Wednesday, 6 May 2020 at 14:28:20 UTC, Timon Gehr wrote:
> On 04.05.20 19:09, Stefan Koch wrote:
>> On Monday, 4 May 2020 at 15:55:44 UTC, Paul Backus wrote:
>>> On Monday, 4 May 2020 at 15:42:01 UTC, Steven Schveighoffer 
>>> wrote:
>>>> [...]
>>> [...]
>>>> [...]
>>>
>>> If I understand the proposal correctly, it should be ok 
>>> handle UFCS the same way std.algorithm.map does, by taking 
>>> the function as a template argument:
>>>
>>> auto map(alias f)(alias[] a) {
>>>     // etc
>>> }
>> 
>> In my current draft type functions are not overload-able.
>> And having UFCS work was never really something I thought 
>> about.
>> I would like to work on a version which does not take UFCS 
>> just as a first step.
>
> That's a bit concerning. Why would overloading and UFCS require 
> a separate implementation for type functions and functions that 
> do not operate on types?

ufcs doesn't work merely because of how it parses right now.
I cannot really see where overloading a type function would make 
sense.
If you have a compelling example where it's useful. I may 
reconsider.


More information about the Digitalmars-d mailing list