Hello list,
I stumbled on some (for me) unexpected behaviour when setting and
getting a property at the same time, which is not consistend with simple
types like int.
When doing something like
int x = (myclass.myproperty = y);
x will be set to y, and not whatever mycalss.myproperty will be
I think that it is pretty consistent and expected behaviour not only in
Vala but in other languages as well (as long as they allow such things). I
would be worried if it would work other way around. Example:
int x, y;
x = 2;
y = x = 3;
I expect that both y and x will have same value, 3. I would n
int x, y = 9;
2012/11/1 Jarosław Ciupiński
> I think that it is pretty consistent and expected behaviour not only in
> Vala but in other languages as well (as long as they allow such things). I
> would be worried if it would work other way around. Example:
>
> int x, y;
> x = 2;
> y = x = 3;
>
>
I just checked it out with C# and it shows exactly the same behaviour. I
expected it to do
x = 3;
y = x;
rather than
x = 3;
y = 3;
Very interesting and good to know.
I think that it is pretty consistent and expected behaviour not only in
Vala but in other languages as well (as long as the