forcing weak purity

Don Clugston dac at nospam.com
Thu May 24 01:58:56 PDT 2012


On 24/05/12 02:26, Alex Rønne Petersen wrote:
> On 23-05-2012 19:16, deadalnix wrote:
>> Le 23/05/2012 17:29, Don Clugston a écrit :
>>> There's a huge difference between "a global collection *may* be
>>> performed from a pure function" vs "it *must* be possible to force a
>>> global collection from a pure function".
>>>
>>
>> Thank you !
>
> I personally disagree that this should be a rationale to not allow the
> latter. D is a systems language and we really should stop trying to
> pretend that it isn't. There's a reason we have a core.memory module
> that lets us control the GC.
>

This is all about not exposing quirks of the current implementation.

The way it currently is, would get you to perform a gc before you enter 
the first pure function.
After that, the only possible garbage to collect would have been 
generated from inside the pure function. And that should be very cheap 
to collect.


More information about the Digitalmars-d mailing list