Discussion Thread: DIP 1029--Add throw as Function Attribute--Final Review

Tove tove at fransson.se
Tue May 5 18:02:00 UTC 2020


On Tuesday, 5 May 2020 at 15:55:30 UTC, Paul Backus wrote:
> On Tuesday, 5 May 2020 at 15:30:38 UTC, Tove wrote:
>> Good digging! I agree with you and Andrei, but using template 
>> syntax would be an additional improvement, it's not about 
>> saving one char, but avoiding matching () in the common case.
>>
>> attribute!true
>> attribute!false
>> attribute!(boolExpr)
>
> It seems more confusing to me to use template syntax for 
> something that isn't a template.
>
> We already use parentheses for stuff like `extern(C)`. Using 
> them for function attributes is a natural extension of that.

It's not a function either and extern!C would be fine with me.

IIRC `extern(C)` existed long before the single argument template 
syntax. It may appear a minor feature, but I miss it a lot when 
forced to use other languages.



More information about the Digitalmars-d mailing list