`@safe` by default. What about `@pure` and `immutable` by default?

sarn sarn at theartofmachinery.com
Tue Apr 16 12:30:08 UTC 2019


On Tuesday, 16 April 2019 at 03:59:38 UTC, Mike Franklin wrote:
> Can anyone save me some trouble and articulate why it would be 
> bad to have `pure` and/or `immutable` by default?

One downside for functions in libraries: authors are more likely 
to break ABIs by switching an exported function from pure to 
impure if pure is the default (as opposed to the current opt-in).

https://theartofmachinery.com/2016/10/05/function_attributes_and_d_abi.html

By the way, your DIP would need a spec for un-applying attributes 
like pure.  That functionality would fill a big gap by itself.


More information about the Digitalmars-d mailing list