[dmd-beta] beta 2

David Simcha dsimcha at gmail.com
Wed Jul 6 13:09:55 PDT 2011


This is exactly what I was trying to get at, though David Nadlinger stated
it better than I did:  Are we abandoning weak purity?  If so, why?  If not,
please clarify the new rules and explain why the newly disallowed behavior
doesn't fit into the framework of weak purity.

On Wed, Jul 6, 2011 at 3:57 PM, David Nadlinger <code at klickverbot.at> wrote:

> On 7/6/11 9:46 PM, Walter Bright wrote:
>
>> I understand that within a pure function, such a pure function could
>> modify locals without the caller becoming impure. But those functions
>> are still impure.
>>
>
> Isn't this the whole idea behind weak purity, which we introduced in 2.050?
> Weakly pure functions are supposed to be able to modify their arguments, yet
> are still tagged with the »pure« attribute and thus callable from (possibly
> strongly) pure functions.
>
> Whether the implicit this parameter is part of the arguments through which
> external state can be read/modified is a separate another question (though I
> would argue in favor of it, since otherwise objects resp. member functions
> become unnecessarily crippled inside pure functions), but right now it seems
> like you are throwing the whole concept of »weak purity«, i.e. the »relaxed«
> purity rules out of the window. Or did I get you wrong?
>
> David
>
> ______________________________**_________________
> dmd-beta mailing list
> dmd-beta at puremagic.com
> http://lists.puremagic.com/**mailman/listinfo/dmd-beta<http://lists.puremagic.com/mailman/listinfo/dmd-beta>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-beta/attachments/20110706/30872042/attachment.html>


More information about the dmd-beta mailing list