Is there any way to put dictionary inside a dictionary without having to initialize each dictionary first? More like:
dictionary d = {{ 'dict1': {{ 'a', 1 }, { 'b', 2 }},
{ 'dict2': {{ 'c', 3 }, { 'd', 4 }}};
instead:
dictionary subd1 = {{ 'a', 1 }, { 'b', 2 }};
dictionary subd2 = {{ 'c', 3 }, { 'd', 4 }};
dictionary d = {{ 'dict1': subd1 },
{ 'dict2': subd2 }};
Right now I'm getting error:
ERR : Initialization lists cannot be used with '?'
ERR : Reference is read-only
PS. Just realized { } is for initializer list, so it's used for arrays too and there is no way it will know what I want to construct there. Was thinking more in Python-ish way where {} denotes dictionary and [] is for arrays. Though it wouldn't hurt to make this distinction for such basic type as array/map, unless there are bigger plans for initializer list usage..