Artifacts Associated With Ticket 1037235
Ticket change [0b24650be4] (rid 113933) by muehlebachs on 2004-09-29 19:36:48:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The goal is to create a nested dictionary (foo) with the following mappings: a -> A bc -> b -> B bc -> c -> C One would expect to do it by: dict set foo a A dict set foo bc b B dict set foo bc c C But this leads to the error (key "bc" not known in dictionary). Instead it has to be done by: dict set foo a A dict set foo bc [dict create b B c C] After the mappings are created, the values can be changed by: dict set foo a AA dict set foo bc b BB dict set foo bc c CC The different treatment of mappings at the 'top level' and at a 'lower level' should either be removed/corrected or mentioned in the docu. - foundin initialized to: "obsolete: 8.5a1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "muehlebachs"
- subsystem initialized to: "15. Dict Object"
- title initialized to: "Inconsistency in 'dict set'"
- type initialized to: "Bug"
Ticket change [0ecd859209] (rid 94677) by dkf on 2004-09-30 17:31:49:
- icomment:
Logged In: YES user_id=79902 Workaround: Put dict set foo bc {} before you set the components of bc Problem: only safe when know element does not exist or is empty Workaround #2: Put dict append foo bc sometime before you set the components of bc; this will create the dictionary entry if it does not already exist, and will otherwise have no effect. (i.e. it is safe and won't lose data. As it happens, it also won't do loads of shimmering either, which is even better!) - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [a6a626d50f] (rid 98642) by dkf on 2004-09-30 17:53:30:
- icomment:
Logged In: YES user_id=79902 Question: What do you think the following should do: set foo {} dict set foo a A dict unset foo bc b dict set foo bc c C (I ask because it affects exactly what kind of fix is to be designed.) - login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [54a8af0f5f] (rid 93987) by dkf on 2004-09-30 19:18:11:
- icomment:
Logged In: YES user_id=79902 BTW, the difference is currently between the leaf dictionary and the branch dictionaries.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [284c13b59a] (rid 88679) by muehlebachs on 2004-10-02 02:27:52:
- icomment:
Logged In: YES user_id=1130415 Thanks for your respons(es). The first workaround looks quite reasonable to me. Answers to your question: set foo {} dict set foo a A >>> creates a new mapping in 'foo': a->A dict unset foo bc b >>> error! since there is no key 'ab' in 'foo' dict set foo bc c C >>> creates a new mapping in 'foo': bc->c->C So the resulting dictionary should look like: a A bc {c C} - login: "muehlebachs"
- mimetype: "text/plain"
- username: "muehlebachs"
- icomment:
Ticket change [0e4acdb3c2] (rid 94590) by dkf on 2004-10-04 14:53:37:
- closedate changed to: "2004-10-04T07:53:37"
- closer changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 Thanks for your feedback; that's now the way that dictionaries behave in the HEAD. :^)
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "dkf"