Memory allocation purity

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


On Thursday, 15 May 2014 at 06:29:06 UTC, bearophile wrote:
> A little example of D purity (this compiles):

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

Yes, and then you may as well allow a random generator with 
private globals. Because memoing is no longer sound anyway.



More information about the Digitalmars-d mailing list