Isolated by example
deadalnix via Digitalmars-d
digitalmars-d at puremagic.com
Fri May 2 16:03:20 PDT 2014
On Friday, 2 May 2014 at 20:10:04 UTC, Marc Schütz wrote:
> 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
>
Yes.
>>> 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.
Yes, but this is unrelated to isolated. In fact this is already
the case. static if is not deterministic. I've made a proposal to
improve the situation:
http://wiki.dlang.org/DIP31
But to be fair I'm not quite satisfied. This still leave some
room for unspecified results, but is a great improvement over
current situation.
More information about the Digitalmars-d
mailing list