Isolated by example

via Digitalmars-d digitalmars-d at puremagic.com
Fri May 2 13:10:02 PDT 2014


On Friday, 2 May 2014 at 18:10:42 UTC, deadalnix wrote:
> On Friday, 2 May 2014 at 09:41:48 UTC, Marc Schütz wrote:
>> That's true, but it is also a breaking change, because then 
>> suddenly some variables aren't writable anymore (or

s/writable/readable/ of course

>> alternatively, the compiler would have to analyse all future 
>> uses of the variable first to see whether it can be inferred 
>> isolated, if that's even possible in the general case). I 
>> believe it's fine if explicit annotation is required.
>
> No, I expect the compiler to backtrack inference when it hits 
> an error, not to infer eagerly, because indeed, the eager 
> inference would be a breaking change.

This might work, but would require defining an order of 
evaluation for static if's &co, because you could create logical 
cycles otherwise.


More information about the Digitalmars-d mailing list