persistent namespace import: routine resolution when target routine is deleted and recreated
namespace eval n1 {
namespace export *
proc hello {} {
puts hello
rename hello {}
proc hello {} {
puts goodbye
}
}
}
namespace eval n2 {
namespace import [namespace parent]::n1::hello
hello
hello
}
produces the error invalid command name "hello".
However, if rename hello {} is removed, there is no error.
I'm pretty sure we'd close this ticket (as incorrect), because this work as expected:
If you execute `rename hello {}` in-between this REMOVES also all imported links in all referenced namespaces (otherwise we'll get leaks).
Without this removal the linked command could still remain, because it is simply replaced.
As discussed in tcl-chat, it looks rather like a RFE: need a way to provide a persistent import of all commands exported from other namespace.
This would affect namespace command resolver similar way like an alias (thus persistent) but only for the exported commands (therefore `namespace path`, `interp alias` etc are not an option for this purposes).