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

History Of Ticket 1592212fffffffff

Artifacts Associated With Ticket 1592212fffffffff

  1. Ticket change [17dda15799] (rid 122569) by msofer on 2006-11-07 19:19:09:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      (See also Bug 1444291; all of this also applies to
      ensemble redirection)
      
      The way unknown and namespace unknown work is: they get
      the full command line, do some reprocessing to
      determine or load the command that was not found, and
      then run the reprocessed command in [uplevel 1]. The
      return value of that upleveled command is then taken as
      the return value of the original.
      
      In order to function properly, this assumes that the
      level immediately above provides the right context for
      both command lookup and command execution. But alias
      targets should be looked up in the global context, and
      then executed in the caller's context. 
      
      The scriptlet below is wrong (result of calling a
      command directly or thorugh an alias should be the
      same), but the alternative (previous to fixing 1444291)
      would also be wrong, as can be seen in that bug report.
      
       % proc unknown args {uplevel 1 namespace current}
       % interp alias {} y {} x
       y
       % x
       ::
       % y
       ::
       % namespace eval a x
       ::a
       % namespace eval a y
       ::
      
      
      One possible (incomplete) solution is for aliases to
      always call their target with a FQ name, so that
      [unknown] does not care if [uplevel 1] provides the
      wrong resolution context. This can be salvaged in the
      core, but who knows what might happen with custom
      unknown procs that override ::unknown.
      
      Another alternative is for aliases not to call unknwon
      when they do not find their target, as was the case in
      Tcl7.6.
      
      Note that [namespace unknown] is almost impervious to
      this: the only way to have a non-global command be an
      alias target is by providing a qualified name (that is
      interpreted as rooted in :: even if not FQ). So an
      alias target can only call the global namespace's unknown.
      
    4. foundin initialized to: "obsolete: 8.5a6"
    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: "msofer"
    10. subsystem initialized to: "45. Parsing and Eval"
    11. title initialized to: "[interp alias] and [unknown] cannot work together"
    12. type initialized to: "Bug"