Memory allocation purity

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Wed May 14 23:29:05 PDT 2014


Ola Fosheim Grøstad:

> If the result of a series of pure function calls can be used to 
> flip a coin within a transaction, then those functions cannot 
> be considered pure in any meaningful sense.

A little example of D purity (this compiles):


bool randomBit() pure nothrow @safe {
     return (new int[1].ptr) > (new int[1].ptr);
}
void main() {}


Bye,
bearophile


More information about the Digitalmars-d mailing list