Posted to tcl by stu at Sat Sep 03 11:20:59 GMT 2022view raw

  1. $ cat e.tcl
  2. puts [info tcl]
  3.  
  4. namespace eval a {
  5. proc q {} { return q }
  6. namespace ensemble create -prefixes no -command a -subcommands [list q]
  7. namespace export a
  8. }
  9.  
  10. namespace import a::a
  11.  
  12. puts [a q]
  13.  
  14. namespace eval a { namespace eval b {
  15. proc z {} { return z }
  16. namespace eval ::a { namespace path b }
  17. namespace ensemble configure ::a::a -subcommands \
  18. [concat [namespace ensemble configure ::a::a -subcommands] \
  19. [list z]]
  20. }}
  21.  
  22. puts [a z]
  23.  
  24.  
  25. $ tclsh8.6 e.tcl ; tclsh8.5 e.tcl
  26. 8.6
  27. q
  28. z
  29. 8.5
  30. q
  31. invalid command name "::a::z"
  32. while executing
  33. "a z"
  34. invoked from within
  35. "puts [a z]"
  36. (file "e.tcl" line 21)