They are not the same

Timon Gehr timon.gehr at gmx.ch
Wed Apr 9 11:01:28 PDT 2014


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.


More information about the Digitalmars-d-learn mailing list