Posted to tcl by hypnotoad at Wed Oct 03 14:29:49 GMT 2018view raw

  1. % package require dicttool
  2. 1.2
  3. % dicttool::dictset myvar foo bar baz {Value is bing}
  4. % set myvar
  5. . {} foo {. {} bar {. {} baz {Value is bing}}}
  6. % dicttool::dictset othervar foo bar doodle has stuff {The value is not a dict}
  7. . {} foo {. {} bar {. {} doodle {. {} has {. {} stuff {The value is not a dict}}}}}
  8. % dicttool::merge $myvar $othervar
  9. . {} foo {. {} bar {. {} baz {Value is bing} doodle {. {} has {. {} stuff {The value is not a dict}}}}}
  10. % dicttool::print [dicttool::merge $myvar $othervar]
  11. foo {
  12. bar {
  13. baz {Value is bing}
  14. doodle {
  15. has {
  16. stuff {The value is not a dict}
  17. }
  18. }
  19. }
  20. }