Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 50bcecc51896e0131b950c29223cadbae6442210461134f2e66cc8a4ffc38359
Ticket: f14b33ec9f900721ce156147ebd418ff7b930117
changed behaviour wrt command names, namespaces and resolution
User & Date: emiliano on 2024-09-05 23:59:16
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-plain"
  4. comment changed to:
    In Tcl up to 8.6 creating a command with a leading single colon is forbidden in all namespaces except the root {} namespace:
    
    $ tclsh8.6 
    % namespace eval foo {proc :bar {} {puts hi}}
    can't create procedure ":bar" in non-global namespace with name starting with ":"
    
    This makes sense since such command is unreachable using its fully qualified name. ::foo:::bar resolves to the 'bar' command in the 'foo' namespace, given the rule that 'two or more colons' are namespace separators.
    
    With Tcl 9, however, it's possible to create such command, but it can't be reached using its full qualified name:
    
    $ tclsh9.0 
    % namespace eval foo {proc :bar {} {puts hi}}
    % namespace eval foo {namespace which :bar}
    ::foo:::bar
    % ::foo:::bar
    invalid command name "::foo:::bar"
    
    This change will undoubtely affect a lot of Tk applications since it's common practice to use [namespace which] to fully qualify bindings and other callbacks.
    
    Tcllib will be affected too, for example math::calculus uses [namespace which] to fully qualify procs used as functions.
    
  5. foundin changed to: "9.0"
  6. is_private changed to: "0"
  7. login: "emiliano"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "emiliano"
  13. subsystem changed to: "21. [namespace]"
  14. title changed to:
    changed behaviour wrt command names, namespaces and resolution
    
  15. type changed to: "Bug"