Overview
| Artifact ID: | 9bcd341542425464adc09ba12789e4f7e101ab85ddb48fc9af1965ea1248b40a |
|---|---|
| Ticket: | 66c2e8c97414a1f908d48753490526bb1cded0f4
Interpreter name resolution has problems with namespaces |
| User & Date: | kjnash on 2020-07-21 12:15:47 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
The interp command recognizes "foo" and "::foo" as different interpreter names. However, the two interpreters have the same interpreter command. When "::foo" is created below, the command for interpreter "foo" is overwritten and so interpreter "foo" is deleted. The problem is that, because "interp" creates a command for each interpreter, its rules for name resolution should not differ from the rules for name resolution of commands. Suggested remedy: "interp" should recognize interpreter names as equal only if their fully-qualified namespace names are equal. When there are multiple levels of interpreters, e.g. a slave ::foo with its own slave {::foo ::bar}, the name in the master interpreter is a list, and each element in the list should be compared with its peers by their fully-qualified namespace names. This ensures the same outcome if interpreter {::foo ::bar} is created in the master, as if interpreter ::bar is created in the slave ::foo. The usual, expected behavior: % interp create foo foo % interp create foo interpreter named "foo" already exists, cannot create The unexpected behavior: % interp create foo foo % interp create ::foo ::foo % interp slaves ::foo Check that the interpreter really has been replaced: % interp create foo foo % foo eval set a abc abc % foo eval set a abc % interp create ::foo ::foo % interp slaves ::foo % foo eval set a can't read "a": no such variable For maximum surprise, move the first interpreter's command so that interpreters foo and ::foo can coexist: % interp create foo foo % interp eval foo set a abc abc % interp eval foo set a abc % rename foo moved % interp create ::foo ::foo % interp slaves ::foo foo % interp eval foo set a abc % interp eval ::foo set a can't read "a": no such variable % moved eval set a abc - foundin changed to: "8.6.10"
- is_private changed to: "0"
- login: "kjnash"
- priority changed to: "5 Medium"
- private_contact changed to: "a774b1f5653dc3360e29ea7d635a64e94c9f1dab"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "kjnash"
- subsystem changed to: "20. [interp]"
- title changed to:
Interpreter name resolution has problems with namespaces
- type changed to: "Bug"