Posted to tcl by stu at Sat Sep 03 11:20:59 GMT 2022view raw
- $ cat e.tcl
- puts [info tcl]
- namespace eval a {
- proc q {} { return q }
- namespace ensemble create -prefixes no -command a -subcommands [list q]
- namespace export a
- }
- namespace import a::a
- puts [a q]
- namespace eval a { namespace eval b {
- proc z {} { return z }
- namespace eval ::a { namespace path b }
- namespace ensemble configure ::a::a -subcommands \
- [concat [namespace ensemble configure ::a::a -subcommands] \
- [list z]]
- }}
- puts [a z]
- $ tclsh8.6 e.tcl ; tclsh8.5 e.tcl
- 8.6
- q
- z
- 8.5
- q
- invalid command name "::a::z"
- while executing
- "a z"
- invoked from within
- "puts [a z]"
- (file "e.tcl" line 21)