Skip to content
Tcl Source Code History Of Ticket 66c2e8c974
Login

History Of Ticket 66c2e8c974

Artifacts Associated With Ticket 66c2e8c974

  1. Ticket change [9bcd341542] (rid 185091) by kjnash on 2020-07-21 12:15:47:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized 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
      
    5. foundin initialized to: "8.6.10"
    6. is_private initialized to: "0"
    7. login: "kjnash"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "a774b1f5653dc3360e29ea7d635a64e94c9f1dab"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "kjnash"
    14. subsystem initialized to: "20. [interp]"
    15. title initialized to:
      Interpreter name resolution has problems with namespaces
      
    16. type initialized to: "Bug"