accept @pure @nothrow @return attributes

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 26 11:57:40 PST 2015


On Mon, Jan 26, 2015 at 11:50:19AM -0800, Walter Bright via Digitalmars-d wrote:
> On 1/26/2015 3:39 AM, Jonathan M Davis via Digitalmars-d wrote:
> >Personally, I'd much prefer that we not make this change.
> 
> It's good to have this discussion.
> 
> Previously, it's all been advocacy and "break my code" by forcing a
> change from pure => @pure.
> 
> Just a few days ago on slashdot, an anonymous D user wrote:
> 
>   "A horrible mix of keywords and annotation syntax for
>   function/method attributes ('const', 'pure', and 'nothrow' are all
>   keywords, but '@property', and '@nogc' are annotations)"
> 
> for why he won't use D anymore.
> 
> Frankly, I think that is a great bikeshedding non-issue that distracts
> us from what is important. I hope that by doing this PR, we can
> actually decide that it isn't worth it, i.e. I'd be happy to get
> consensus and revert it.

While I generally agree with the sentiment that this great debate over
syntax is distracting from more important issues, one particularly
attractive point about forcing @ on annotations is that const (as a type
qualified) and @const (as a function annotation) become syntactically
distinct:

	const int myFunc() @const {}

vs. the current confusing syntax:

	const int myFunc() const {}

Does this alone make it worth it? I'm skeptical. But I thought it should
be pointed out regardless.


T

-- 
If it tastes good, it's probably bad for you.


More information about the Digitalmars-d mailing list