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

Eugene Wissner belka at caraus.de
Thu Apr 18 10:07:57 UTC 2019


On Thursday, 18 April 2019 at 08:53:37 UTC, Jonathan M Davis 
wrote:
> There _are_ rare cases where a piece of code that isn't 
> technically @noglobal is actually able to follow the compiler's 
> guarantees (e.g. std.datetime's LocalTime() is conceptually 
> pure because it always returns exactly the same value every 
> time it's called, but it has to create that value the first 
> time that it's called, because it was determined unacceptable 
> to have static constructors in Phobos - and that means casting 
> to pure).

It isn't conceptually pure, it depends on the state of the word 
after compilation, it is just impure.


More information about the Digitalmars-d mailing list