The problem with @properties in D

Jonathan M Davis jmdavisProg at gmx.com
Tue Dec 13 01:27:30 PST 2011


On Tuesday, December 13, 2011 10:50:13 Manu wrote:
> On 13 December 2011 09:53, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> > On Tuesday, December 13, 2011 07:28:18 F i L wrote:
> > > Can someone please explain why @property and @disabled have a '@'
> > > symbol in front of them?
> > 
> > So that they don't have to be keywords.
> 
> What is the rule for use of '@'?
> It does feel inconsistent to me too...

It _is_ inconsistent. The decisions as to what would have @ and what wouldn't 
was a combination of arbitrariness and what was added when. The keywords have 
generally been around much longer, whereas the symbols which start with @ are 
generally newer, but there was a bit of discussion at one point as to which 
ones would and wouldn't have @ in front of them. The decision was ultimately 
rather arbitrary. All @ symbols are attributes, but there are plenty of 
keywords which are attributes as well.

There are those of use who would like @ to be used for user-defined attributes 
like occurs in Java, but that hasn't happened yet and it may never happen. 
That wouldn't really conflict with the current usage though. The current ones 
would just be system-defined and would be treated like any other system-defined 
attribute.

- Jonathan M Davis


More information about the Digitalmars-d mailing list