On Sat, May 21, 2011 at 06:24, Marc <[email protected]> wrote:
> cool, declaring in the constructor seems to work... thanks a lot!
>
> is this a bug or a feature? ;)
It is a feature of the language, really. Changes to a variable containing a
number gives you a whole new number in that variable. What the variable
references actually changes. OTOH, changes to a member of a map or an array
does not change the map or the array that the variable is referencing.
Instead, it changes the contents of that map or array. If you were to assign
a new map or array to the variable, you'd get the desired effect. (That's
what you did when you moved the assignment into the constructor.) If you
just modify the map or array that was provided in the members: section, the
reference to the map or array is unchanged, so all instances are playing
with the same map or array.
There is qooxdoo documentation talking about this issue. I don't recall
exactly where, though.
Cheers,
Derrell
------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its
next-generation tools to help Windows* and Linux* C/C++ and Fortran
developers boost performance applications - including clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel