OpIndex/OpIndexAssign strange order of execution

SrMordred patric.dexheimer at gmail.com
Mon Sep 18 16:28:25 UTC 2017


On Monday, 18 September 2017 at 15:14:20 UTC, Moritz Maxeiner 
wrote:
> On Monday, 18 September 2017 at 15:11:34 UTC, Moritz Maxeiner 
> wrote:
>>
>> gets rewritten to
>>
>> ---
>> t.opIndex("b").opIndexAssign(t["a"].value, "c");
>> ---
>
> Sorry, forgot one level of rewriting:
>
> ---
> t.opIndex("b").opIndexAssign(t.opIndex("a").value, "c");
> ---

Nice, thanks for the explanation :)

This will be a problem for me because in my use case the internal 
operations of the structs are stack-like manipulations.

So in this case
t["b"]["c"] = t["a"].value;

instead of manipulating the internal stack with "a" then "b" and 
"c" I got this weird order of "b", "a", "c" messing with the 
internal stack logic.

Well, back to work :)





More information about the Digitalmars-d-learn mailing list