April 09, 2014 Re: They are not the same | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On 04/09/2014 07:27 PM, Kagamin wrote:
> On Saturday, 5 April 2014 at 21:33:30 UTC, Timon Gehr wrote:
>> The issue asks for delegates to be typed properly, unless I
>> misunderstand what 'properly' means here.
>
> Isn't the issue in pure nested functions treated as strongly pure?
> What does it have to do with delegates?
The issue is that pure nested functions and delegate literals are not allowed mutable access to data reachable using context pointers.
However, this may also be exactly what is wanted in certain circumstances. 'Delegates are typed properly', I interpreted as meaning for one thing (besides fixing the unsoundness issues) that the 'immutable'/'const' qualifiers can be used on nested functions/delegate literals, which then restores the current behaviour in the case of immutable (i.e. only immutable state can be accessed through context pointers thus annotated.), and would prevent updates to data in the context in the case of const.
|
April 10, 2014 Re: They are not the same | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | Pure functions are allowed to access mutable state without const qualifier. I don't understand, why you want the qualifier and how it would help with consistent implementation of purity. |
Copyright © 1999-2021 by the D Language Foundation