Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 35993e53b58d29899450652e15f4e671e97a813361f16a3b17be887053bd6812
Ticket: 8b9854c3d8ba8d64a7d3a9b20dfec552c8ee5f54
[info level 0] returns incompatible result in exported command since Tcl 8.6.9
User & Date: pooryorick on 2019-06-21 20:57:08
Changes

  1. icomment:
    So in the face of renamed imported commands, <code>info level 0</code> as
    implemented before 8.6.9 is the only way to get at the name of renamed imported
    command.  Below is an example where Tcl 8.6.8 and 8.5.19 are broken, as well as
    8.6.9.  Granted, <code>uplevel</code> would work in this example:
    
    
    <code></verbatim>
    puts "Using Tcl [package present Tcl]"
    namespace eval origin {
        namespace path ::tcl::mathop
        proc foo n {
            if {$n == 0} {return 1}
            return [* $n [namespace inscope [namespace current] [lreplace [info level 0] 1 1 [incr n -1]]]]
        }
        proc fact {n} {error BROKEN!}
        namespace export foo
    }
    
    namespace eval demo {
        namespace import ::origin::foo
        rename foo fact
    	fact 3
    }
    
    Using Tcl 8.6.9
    
    BROKEN!
    
    Using Tcl 8.6.8
    
    BROKEN!
    
    Using Tcl 8.5.19
    
    BROKEN!
    </verbatim></code>
    
    
    I'll close this ticket now and look towards finding a better resolution in
    core-8-branch.
    
  2. login: "pooryorick"
  3. mimetype: "text/x-fossil-wiki"