Perfect forwarding

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Mon Jul 27 21:08:52 UTC 2020


On 7/27/20 11:57 AM, Petar Kirov [ZombineDev] wrote:
> On Monday, 27 July 2020 at 14:08:30 UTC, Andrei Alexandrescu wrote:
>> On 7/26/20 8:19 AM, Andrej Mitrovic wrote:
>>> On Sunday, 26 July 2020 at 11:56:16 UTC, Jacob Carlborg wrote:
>>>> On 2020-07-26 04:10, Andrei Alexandrescu wrote:
>>>>
>>>>> That needs fixed. What primitives would you need for that?
>>>>
>>>> It has already been implemented but rejected [1]. Andrei, you were 
>>>> part of the discussions and approved the changes.
>>>>
>>>> [1] https://github.com/dlang/dmd/pull/5201
>>>
>>> Ah, this was in the back of my head when someone mentioned template 
>>> parameters.
>>>
>>> I haven't looked at that in a long time.
>>
>> Well... would you like to revive it?
> 
> One question that was brought up recently by an unrelated DMD PR [1] was 
> whether new traits require a DIP. None of the traits we added in the 
> past few years have gone through the DIP process as far as I remember. 
> Of course, going through the DIP process can only improve the quality, 
> but on the other hand, one could argue that it would make things 
> unnecessary hard for easy additions like isDeprecated [2] and isDisabled 
> [3].
> 
> How high should the bar be? Should we decide on a case-by-case basis?
> 
> [1]: https://github.com/dlang/dmd/pull/11442#issuecomment-661996482
> [2]: https://github.com/dlang/dmd/pull/7178
> [3]: https://github.com/dlang/dmd/pull/7569

Thanks for asking. I'm no longer in the decision loop but here's what I 
think. There'd be somewhat obvious traits to have ("is this symbol 
deprecated?") and traits that work together toward a larger goal, such 
as perfect forwarding or general introspection itself. In the former 
case acceptance could and should be somewhat quick, whereas in the 
latter case we risk having a hodge-podge of traits that don't combine 
properly to attain the initial goal. In a way we're there right now - we 
added traits on a need basis and we're unclear on what the limits of 
what we can and what we can't do, or how to do it.


More information about the Digitalmars-d mailing list