Proposal: Definition of @-attributes

Leandro Lucarella llucax at gmail.com
Thu Jan 28 08:18:02 PST 2010


Jesse Phillips, el 28 de enero a las 15:39 me escribiste:
> Lars T. Kyllingstad wrote:
> 
> > In the "Function calls" thread the question of "which attributes should 
> > be in the @-namespace" has again come up.
> >
> >
> > Problem:
> > Currently, there doesn't seem to be any clear definition of which 
> > attributes should be prefixed with @ and which shouldn't.  New 
> > attributes get an @, while already existing attributes don't, and it all 
> > seems a bit arbitrary.  Then again, we probably don't want *all* 
> > attributes to be written with @, as that would just make code look messy:
> 
> To me attributes can make the code look uglier and, as pointed out,
> there there really is no clear seperation.
> 
> So in my opinion, to keep the code looking clean attributes should only
> include those for the function, not its parameters. This prevents in,
> out, ref, const, etc. and allows for @safe, @property, etc.

D attributes[1] can't be part of parameters. That are InOut "modifiers"
or storage classes[2] (there are some overlapping between the two, for
example the keyword const is a storage class *and* an attribute, that can
be the cause of confusion).

[1] http://www.digitalmars.com/d/2.0/attribute.html
[2] http://www.digitalmars.com/d/2.0/declaration.html

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------



More information about the Digitalmars-d mailing list