FAQ for newbies who see pure @safe nothrow @nogc

matovitch via Digitalmars-d digitalmars-d at puremagic.com
Thu Jan 29 07:39:16 PST 2015


On Thursday, 29 January 2015 at 15:10:12 UTC, Jonathan Marler 
wrote:
> On Thursday, 29 January 2015 at 10:43:37 UTC, matovitch wrote:
>> On Thursday, 29 January 2015 at 10:38:46 UTC, matovitch wrote:
>>> On Thursday, 29 January 2015 at 10:34:37 UTC, matovitch wrote:
>>>> On Wednesday, 28 January 2015 at 22:32:55 UTC, Jonathan 
>>>> Marler wrote:
>>>>>
>>>>> Why don't we make all the function attributes keywords?
>>>>> -----------------------------------------------------------
>>>>
>>>> As a newbie, I would have asked the reversed question :
>>>>
>>>> Why don't we make all the function attributes attributes?
>>>
>>> To be clear, what are the avantages of keywords vs attributes 
>>> ? Why should the most used function attributes be keywords ?
>>
>> "In theory, the increased consistency is welcome, but the 
>> increased visual
>> noise definitely is not.  And if we leave in pure and nothrow 
>> without @,
>> then we're going to have code out there doing both, which adds 
>> to the
>> confusion, and if we deprecate pure and nothrow without @, 
>> then we'll be
>> forced to change pretty much every D program in existence." JM 
>> Davis
>>
>> Ok !
>
> I'm not sure I understand your question.
>
> Why don't we make all the function attributes attributes?
>
> Is this what you mean? "Why don't we require an '@' symbol 
> before all function attributes?"

Yes, if @ttributes are better because you can create identifier 
with the same name why aren't they used everywhere ? By the way, 
the denomination makes sense too : function attibutes are either 
built-in or user defined attributes. But const can be a qualifier 
or a function/method attribute that is two very different 
things...maybe not beeing able to use const as a function 
attribute but @const would make more sense ?


More information about the Digitalmars-d mailing list