Should pure nothrow ---> @pure @nothrow ?

Denis Koroskin 2korden at gmail.com
Fri Nov 27 03:33:26 PST 2009


On Fri, 27 Nov 2009 13:56:10 +0300, Lars T. Kyllingstad  
<public at kyllingen.nospamnet> wrote:

> Don wrote:
>> #ponce wrote:
>>>> Definitely. And what about @deprecated and @override?
>>>
>>> As override is now required, i don't think it should be an attribute.
>>  As I understand it, one of the characteristics of attributes is that  
>> you should be able to remove them from the entire program, without  
>> affecting the behaviour.  All they are doing is adding additional  
>> compile-time constraints. (const and immutable aren't attributes,  
>> because you're allowed to overload functions based on them).
>
> If this is the rule, shouldn't the protection attributes be moved into  
> the annotation namespace as well? (@private, @protected, @package,  
> @public) Since everything is public by default in D, a program will keep  
> working even if you remove them.
>
> NOTE: I don't necessarily think they should, but I do think there should  
> be a definite rule for which attributes are @annotations and which  
> aren't. Otherwise it just seems random.
>
> -Lars

A straight line needs to be drawn, or we end up with something like this:

@public @final @override @extern (Windows) @naked @deprecated @pure int  
foo() invariant
{
     // ...
}



More information about the Digitalmars-d mailing list