D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4588 - [lex] @ttributes are not documented
Summary: [lex] @ttributes are not documented
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: spec
Depends on:
Blocks:
 
Reported: 2010-08-05 10:01 UTC by anonymous4
Modified: 2012-01-23 21:39 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description anonymous4 2010-08-05 10:01:07 UTC
http://www.digitalmars.com/d/2.0/lex.html
@ character is not listed as a token.

http://www.digitalmars.com/d/2.0/attribute.html
Various attributes like @safe and @pure are not listed.

http://www.digitalmars.com/d/2.0/function.html
Alternative syntax for pure and nothrow attributes is not documented.

http://www.digitalmars.com/d/2.0/declaration.html
New function attributes like @safe and @trusted are not listed neither as StorageClass nor as FunctionAttribute.
Comment 1 Bernard Helyer 2011-01-10 17:50:15 UTC
It's not that there's an alternative syntax for pure and nothrow, it's that (like immutable) they are both a storage class and attributes (the attribute form merely imbuing scoped declarations with the corresponding storage class). They should be listed in the attribute page, but aren't.
Comment 2 Jonathan M Davis 2011-01-10 19:09:22 UTC
I would expect @pure and @nothrow to be going away. It was decided to go with pure and nothrow rather than @pure and @nothrow, so I don't see why the @ versions would be sticking around. We ended up with both, because it was debated as to what should use @ and what should be a keyword.

@safe, @trusted, and @system are all valid, as is @property. However, I can't think of any others at the moment which are actually currently supposed to have @ on the front.

And as for @ being a token, I'm not sure that it _is_ a token. I'd have to look at the lexer code to verify one way or another. Given the way that @ is used, I think that there's a decent chance that @safe, @trusted, @system, and @property are all considered tokens and @ isn't. I would like it to be though, since it would be necessary if we're ever going to get user-defined attributes.
Comment 3 Ellery Newcomer 2011-01-22 13:06:41 UTC
(In reply to comment #0)
> http://www.digitalmars.com/d/2.0/lex.html
> @ character is not listed as a token.
> 

It is listed as a token now
Comment 4 Walter Bright 2012-01-23 21:39:40 UTC
These are all taken care of.