pure, safe and generalized attributes

Knud Soerensen 4tuu4k002 at sneakemail.com
Sat Apr 5 08:13:04 PDT 2008


Leandro Lucarella wrote:
> Janice Caron, el  4 de abril a las 08:42 me escribiste:
>> On 04/04/2008, Knud Soerensen <4tuu4k002 at sneakemail.com> wrote:
>> <snip>
>>
>> Nice. But to avoid accruing an infinite number of keywords, the syntax
>> needs to be slightly changed. Instead of
>>
>>     int func(param p1) KilroyWasHere
>>     {
>>         ...
>>     }
>>
>> use
>>
>>     int func(param p1) attribute(KilroyWasHere)
>>     {
>>         ...
>>     }
> 
> Or something simpler, like Python's decorators:
> 
> @KilroyWasHere
> int func(param p1)
> {
>     ...
> }

I like the idea with @ as short for (at)tribute.



More information about the Digitalmars-d mailing list