Hello!
I want to create a multidimensional array of dicts, say 4x4. My first guess
was to use the function fill()
julia> my_array_of_dicts = fill(Dict(), 4, 4)
I want to include a new element to one of the dicts, say in position 2,2. So
julia> my_array_of_dicts[2,2]["somekey"] = ["somevalue"]
but what I get is
julia> my_array_of_dicts
4x4 Array{Dict{Any, Any}, 2}:
{"somekey"=>"somevalue"} . {"somekey"=>"somevalue"}
{"somekey"=>"somevalue"} . {"somekey"=>"somevalue"}
{"somekey"=>"somevalue"} . {"somekey"=>"somevalue"}
{"somekey"=>"somevalue"} . {"somekey"=>"somevalue"}
so, basically the reference of every element of the array points to the
same object and all of the positions of the matrix are modified. Is there
any more suitable way to initialize a matrix of arrays without having this
problem?