www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Proposal: Relax rules for 'pure'

Steven Schveighoffer:

 mark strongly pure functions as pure, mark  
 functions that access global data as something else (global?) and weakly  
 pure functions just aren't marked.

This looks better than the current design. When porting code to D from other languages you need to add something like a globals attribute, but this seems an acceptable price to pay. Time ago I have suggested an attribute to regulate the usage of global (outer) names inside functions; the weak purity seems an "extreme" version of it. Bye, bearophile
Sep 26 2010