FAQ for newbies who see pure @safe nothrow @nogc

Jonathan Marler via Digitalmars-d digitalmars-d at puremagic.com
Thu Jan 29 09:57:18 PST 2015


On Thursday, 29 January 2015 at 17:50:23 UTC, matovitch wrote:
> About the lists
>
> Qualifiers : const (can be an method attribute), immutable (can
> be an method attribute), inout, shared, (scope ?)
>
> Attributes : const (can be a type qualifier), immutable (can be 
> a
> type qualifier), final (even so I don't understand why private
> final is so special), pure, @nothrow, @property, @nogc,...
>
> Neither qualifier nor attributes : abstract, override,... and
> many others
>
> Why "override" is not a method attribute...because if you remove
> it you've change the "semantic" of the code..."final" doesn't
> change anything if you remove it. To me, a function/method
> attribute enforce a behaviour on the function but you should be
> able to remove it without changing the "semantic".

I'll need a better definition of what a qualifier/attribute is.  
It's ok to use words like "qualifier" and "attribute" when 
discussing ideas, but I'm trying to document how this idea would 
really affect everything so I need a solid definition of what you 
mean by a qualifier and an attribute.  You said an attribute 
enforces a behavior on the function but you should be able to 
remove it without changing the "semantics".  What do you mean by 
semantics, because under my definition of semantics, removing a 
function qualifier does change the semantics.  Maybe a better 
definition is, removing it doesn't change the logic of the 
function?  Not sure.  Maybe you can come up with a better 
definition.  Thanks.


More information about the Digitalmars-d mailing list