Proposal: Relax rules for 'pure'

bearophile bearophileHUGS at lycos.com
Sun Sep 26 06:27:56 PDT 2010


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


More information about the Digitalmars-d mailing list