Eval order, bug or design decision?

Frank Benoit keinfarbton at googlemail.com
Sat Mar 8 07:39:02 PST 2008


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?



More information about the Digitalmars-d mailing list