Hello Community,
when I have experimented a little with
arrays, I came to the conclusion, that haxe does
not treat them as
referential datatypesExample:
var greatArr : Array<String> = new Array<String>();
greatArr[ 0 ] = "Great!";
var referential : String = tollArr[ 0 ];
greatArr[ 0 ] = "Fantastic!";
trace( referential );
For my opinion, the variable referential should have the value "Fantastic", as it should point to the same address like greatArr[ 0 ] if it where a referential datatype
( or did I get something wrong? )
But actually it is still "Great!"
So obviously it is not treated as a referential datatype.
Question A: Does this behaviour depend on the target?
I would like to store a nested structures of enum constructors storing arrays of enum constructors storing arrays of...
I also would like to use a variable that stores the present item. This should be just a reference to the array item address (if it would be a referential datatype). Then the present item could be accessed easily via this variable without to surf effortly through the whole nested structure of the array of enums.
Question B: Does anybody have an idea how this could be achieved?
Kind regards
Michael