Multiple assignment
spir
denis.spir at gmail.com
Sat Feb 26 00:46:54 PST 2011
On 02/26/2011 01:56 AM, bearophile wrote:
> Is this program showing a bug in multiple assignments (DMD 2.052)?
>
>
> void main() {
> int i;
> int[2] x;
> i, x[i] = 1;
> assert(x == [1, 0]); // OK
>
> int j;
> int[2] y;
> y[j], j = 1;
> assert(y == [0, 0]); // Not OK
> }
>
>
> At the end of the program I expect y to be [1,0] instead of [0,0].
I'm far to be a C expert, but that looks like very normal C semantics, ain't
it? with all its stupidity, indeed...
I would enjoy an error in both cases. (not enough rvalues)
Denis
--
_________________
vita es estrany
spir.wikidot.com
More information about the Digitalmars-d-learn
mailing list