Custom attributes (again)

deadalnix deadalnix at gmail.com
Fri Apr 6 13:19:19 PDT 2012


Le 06/04/2012 12:28, Walter Bright a écrit :
> On 4/6/2012 3:23 AM, Manu wrote:
>> What about:
>>
>> struct editor
>> {
>> this(string name, EditType, Colour = Colour.Default, string
>> description = null)
>> {
>> //...
>> }
>>
>> blah blah blah
>> }
>>
>> @attr(editor("thing",...blah...))
>
> Are you really changing the arguments for every declaration? Or is it
> one set that is repeated everywhere?
>
>
>> I don't see the advantage over:
>> @editor(...)
>>
>> ?
>
> Name collisions with other @ attributes.
>

That isn't a good argument IMO. We have type int and user defined types. 
I cannot do struct int {}. Same for @safe or @property or any other 
language defined property.


More information about the Digitalmars-d mailing list