www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Implementing Pure Functions

Andrei:

On the bright side, inference is great - no more need for the user to bother
with annotations, the compiler takes care of it. Furthermore, the compiler may
opportunistically infer function attributes (pure, nothrow etc.) if it wants to
optimize a specific context.<

Thank you for your answers. This automatic purity algorithm looks able to implement a D "compiler tip" similar to the warning "-Wsuggest-attribute=pure" of GCC 4.6 (compiler tip != compiler warning): http://d.puremagic.com/issues/show_bug.cgi?id=5137 Bye, bearophile
Jun 17 2011