Attribute Keywords [was Re: @disable]

Jesse Phillips jessekphillips+D at gmail.com
Sat Jan 16 10:17:45 PST 2010


Michal Minich wrote:

> On Sat, 16 Jan 2010 00:58:36 -0600, Andrei Alexandrescu wrote:
>
>> I'd also like to see other keywords (nothrow, pure, override come to
>> mind) transferred into the attribute space.
>
> I'd welcome if that happens. My personal favorite is "align", it is 
> common, hard to replace word when one works with text/graphics/forms/
> layout stuff, and as D keyword, it is rarely used.
>
> Some other candidates are at http://www.digitalmars.com/d/2.0/
> attribute.html, maybe except "auto", it feels more like command to me 
> than attribute.
>
> What about immutable/const - are they @attributes?. Also function 
> parameter attributes = in/inout/ref - will it be possible to apply 
> attribute to fn parameters?
>
> (It seems that what should be @attribute and what not is for big 
> discussion.)

Don't forget that some suggestions are found in the DIP:

http://www.prowiki.org/wiki4d/wiki.cgi?LanguageDevel/DIPs/DIP6

Personally I don't think it would be good for things like in, out,
ref... i.e. what you would find in a function parameter-list:

@pure int add(@in int a, @in int b) {
         return a + b;
}

:P



More information about the Digitalmars-d mailing list