accept @pure @nothrow @return attributes

Zach the Mystic via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 26 15:50:11 PST 2015


On Monday, 26 January 2015 at 23:32:59 UTC, Jonathan Marler wrote:
> Copy/Paste:
>
>>> solution).  By restricting the attributes to only appear 
>>> after a function signature, it would also normalize the issue 
>>> of consistent location of attributes, but this is another 
>>> debate.
>
> The return type doesn't appear after the function signature.

Yes it *is* another debate. Now you can't add attributes at the 
beginning:

// no can do anymore
nogc pure myUda
retType funcName() {
    ...
}

// must do this instead
retType funcName() nogc pure myUdal {
}

You're suggesting canceling a whole style of labeling a function, 
aren't you? It's a big change. I wouldn't accept it unless it 
demonstrated a clear advantage. In fact, maybe it *can* 
demonstrate such, having all D functions be uniform in how their 
attributes are written, but you'll need a whole new thread and a 
DIP, and personally I don't see this carrying its weight.


More information about the Digitalmars-d mailing list