GC.malloc is pure - wat

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 25 20:06:49 PDT 2015


On Friday, 24 April 2015 at 23:27:36 UTC, Steven Schveighoffer 
wrote:
>> pure function can access global immutable state that wasn't 
>> passed to
>> it, so you may want to revise your definition.
>
> Sure: s/accessing/altering, my mistake.
>
> -Steve

That is the whole point. See it as follow: GC.malloc create new 
state. As long as this new state doesn't escape the pure 
function, it is as if that state was local.


More information about the Digitalmars-d mailing list