The problem with @properties in D

Robert Jacques sandford at jhu.edu
Tue Dec 13 08:03:17 PST 2011


On Tue, 13 Dec 2011 03:50:13 -0500, Manu <turkeyman at gmail.com> 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...
>

@word are attributes. Attributes were added late to the D language in order to minimize the effects of adding new keywords, so there are some keywords (i.e. pure) that might have been considered for attribute status had they been incorporated after attributes were available. At one point in time, user defined attributes were to be allowed but that's still on the enhancement list. We haven't gone back and normalized the older keywords as that would result in the pointless breaking of existing code.


More information about the Digitalmars-d mailing list