Eval order, bug or design decision?
Walter Bright
newshound1 at digitalmars.com
Sat Mar 8 10:32:56 PST 2008
Frank Benoit wrote:
> int[] a1, a2;
> // ....
>
> int idx = 0;
> a1[idx] = a2[idx++];
>
> In Java this has another result like in D.
> Java will evaluate from left to right, D does the increment befor doing
> the assignment, so the copied values go into different fields.
>
> Is this a bug or design decision?
Currently order of evaluation dependencies are illegal in D. Did you run
across it in some Java code?
More information about the Digitalmars-d
mailing list