Skip to content
Tcl Source Code History Of Ticket 2028793fffffffff
Login

History Of Ticket 2028793fffffffff

Artifacts Associated With Ticket 2028793fffffffff

  1. Ticket change [fdbf581432] (rid 108466) by lars_h on 2008-07-26 15:36:10:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      This is probably missing documentation rather than an actual bug, but it's nonetheless rather strange behavior.
      
      % namespace eval test {interp alias {} foo {} list "From foo"; interp alias {} test::foo {} list "From test::foo"}
      test::foo
      % foo
      {From foo}
      % test::foo
      Error: invalid command name "test::foo"
      % info commands test::*
      % namespace children test
      ::test::test
      % info commands test::test::*
      ::test::test::foo
      % ::test::test::foo
      {From test::foo}
      
      The behaviour, which is inherited from Tcl_CreateObjCommand, is:
      
      - aliases whose srcCmd does not contain a namespace separator are created in the :: namespace.
      
      - aliases whose srcCmd contains a namespace separator are created relative to the current namespace context (in the interpreter where the command is being created!). As in the above example, a not fully qualified name is resolved relative to the current namespace (::test) even if the target namespace (::test::test) doesn't exist yet!
      
      This is rather different from [proc], but I notice when experimenting with the issue that [rename] and [namespace ensemble create -command] are similarly capable of creating namespaces.
      
      
      
    4. foundin initialized to: "obsolete: 8.5.2"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "lars_h"
    10. subsystem initialized to: "20. [interp]"
    11. title initialized to: "Namespace dependence of interp alias"
    12. type initialized to: "Bug"
  2. Ticket change [35099e35c0] (rid 106851) by dkf on 2012-05-30 17:53:40:

    1. icomment:
      The most surprising part is that [interp alias] returned a name that was not fully qualified. The second most surprising is that [proc] is inconsistent with everything else.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  3. Ticket change [50c1e30199] (rid 126029) by lars_h on 2012-05-30 19:25:26:

    1. icomment:
      @dkf: That the return value isn't fully qualified isn't that strange, when you consider that [interp alias] isn't supposed to return the name of the command it creates; what it in principle returns is merely a handle for the alias, which just so happens to look like the corresponding command name. The whole "handle, not command name" business is of course strange (but understandable, once you dwelve into it).
      
      As for the command creation behaviour, I would suspect it is [proc] that is principally right (two cases is less than three), and Tcl_CreateObjCommand that has a hack to make life easier for Tk and similar extensions. [interp alias] and the like are however poorly served by this hack.
      
      
    2. login: "lars_h"
    3. mimetype: "text/plain"
    4. username: "lars_h"
  4. Ticket change [307d2c2f48] (rid 93264) by lars_h on 2012-05-30 19:25:27:

    1. foundin changed to: "obsolete: 8.5.11"