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

Kagamin spam at here.lot
Tue Apr 16 09:59:31 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?

Among other things immutable by default needs shadowing to reduce 
namespace pollution. Pure is good for some leaf functions, but is 
not workable in general case, also needs usual haskell-style 
purity infrastructure like IO monad, and likely succinct currying 
and lazy evaluation. Imagine refactoring if something deep 
suddenly needs to do IO - the usual problem for pure languages.


More information about the Digitalmars-d mailing list