Official D Grammar

Paulo Pinto pjmlp at progtools.org
Wed Apr 24 01:35:29 PDT 2013


On Wednesday, 24 April 2013 at 01:40:52 UTC, Jonathan M Davis 
wrote:
> On Tuesday, April 23, 2013 21:51:54 Stewart Gordon wrote:
>> Er, do away with the meaningless @? Since nobody seems to have
>> succeeded in explaining how the @-attributes differ from the 
>> rest, it
>> seems the right way to go.
>
> That would mean creating more keywords, which would break code. 
> By using @, we
> avoid having to create new keywords, which I believe was the 
> whole point in
> the first place. Which attributes got @ on them was fairly 
> arbitrary, but they
> do definitely serve a purpose. And any new attributes in the 
> future will
> probably have @ on them for the same reason.
>
> - Jonathan M Davis

Please don't.

This was the approach taken by Java with the @overload and 
friends, which leads to ugly code in my opinion.

Once I worked in a project which took a similar approach, we 
would have annotations as a way to extend the core grammar. Each 
team eventually grew its own set of annotations, to the point the 
amount of annotations became bigger than the core grammar itself, 
with overlapping meaning.

--
Paulo


More information about the Digitalmars-d mailing list