Ticket UUID: | b2964460b617adb8399bc67ca691e1039b49bd0b | |||
Title: | persistent namespace import: routine resolution when target routine is deleted and recreated | |||
Type: | RFE | Version: | ||
Submitter: | pooryorick | Created on: | 2019-01-09 00:18:54 | |
Subsystem: | 21. [namespace] | Assigned To: | nobody | |
Priority: | 5 Medium | Severity: | Minor | |
Status: | Open | Last Modified: | 2019-01-09 11:01:38 | |
Resolution: | None | Closed By: | nobody | |
Closed on: | ||||
Description: |
(text/x-fossil-wiki)
The following script, <code><verbatim> 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 } </verbatim></code> produces the error <code> invalid command name "hello"</code>. However, if <code>rename hello {}</code> is removed, there is no error. | |||
User Comments: |
sebres added on 2019-01-09 11:01:38:
(text/x-fossil-wiki)
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). sebres added on 2019-01-09 09:49:50: (text/x-fossil-wiki) I'm pretty sure we'd close this ticket (as incorrect), because this work as expected:<br/> If you execute `rename hello {}` in-between this REMOVES also all imported links in all referenced namespaces (otherwise we'll get leaks).<br/> Without this removal the linked command could still remain, because it is simply replaced. |