I am trying to make use of the new association and dataset capabilities and ran into a problem constructing a hierarchical structure, as in the code below. Do any of you see what i am doing wrong?
(* define an association *)
as = Association[{}]
(* \[LeftAssociation]\[RightAssociation] *)
(* add a key \[Rule] value at the top level *)
AssociateTo[as, "name" -> "myName"]
(* \[LeftAssociation]"name"\[Rule]"myName"\[RightAssociation] *)
(* add another key whose value is an association *)
AssociateTo[as, "summary" -> Association[{}]]
(* \[LeftAssociation]"name"\[Rule]"myName","summary"\[Rule]\
\[LeftAssociation]\[RightAssociation]\[RightAssociation] *)
(* so as[["summary"]] is an association *)
as[["summary"]] // Head
(* Association *)
(* so why can't I add a key\[Rule]value to it? *)
AssociateTo[as[["summary"]], "stuff" -> "someStuff"]
AssociateTo::rvalue: as[[summary]] is not a variable with a value, so its value cannot be changed. >>
AssociateTo[as[["summary"]], "stuff" -> "someStuff"]
Attachments: