From: SourceForge.net <no...@so...> - 2004-09-30 10:31:52
|
Bugs item #1037235, was opened at 2004-09-29 20:36 Message generated for change (Comment added) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1037235&group_id=10894 Category: 15. Dict Object Group: current: 8.5a1 Status: Open Resolution: None Priority: 5 Submitted By: Stefan Muehlebach (muehlebachs) Assigned to: Donal K. Fellows (dkf) Summary: Inconsistency in 'dict set' Initial Comment: 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. ---------------------------------------------------------------------- >Comment By: Donal K. Fellows (dkf) Date: 2004-09-30 11:31 Message: 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!) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1037235&group_id=10894 |