Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 06462983f819e3796e65b75205baeafec825fe64
Ticket: 967565ffffffffffffffffffffffffffffffffff
[info level] reports current interp's CallFrames only
User & Date: mistachkin on 2004-06-06 12:15:51
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Unless I have missed something in the docs (which is 
    entirely possible at this hour), this behaviour is either a 
    bug or a documentation oversight.  
    
    Is there some bad interaction here between slave 
    interps and [interp alias]?  Perhaps the combination of 
    slave interps and namespaces triggers this problem?  
    
    If this is NOT a bug, it is still downright confusing.  
    Having [info level] "skip over" a caller in the stack is not 
    ideal.
    
    ----
    
    namespace eval ::test {
      proc procA { interp } {
        if {$interp} then {
          global i
          interp alias $i ::test::A::procB {} ::test::procB
          interp eval $i [list namespace eval ::test::A procC]
        } else {
          interp alias {} ::test::A::procB {} ::test::procB
          namespace eval ::test::A procC
        }
      }
    
      proc procB {} {
        set current [lindex [info level [info level]] 0]
    
        # should print "::test::procB"
        puts stdout "current ([info level]) == $current"
    
        if {$current == "::test::procB"} then {
          puts stdout "SUCCESS, current proc match."
        } else {
          puts stdout "FAILURE, current proc mismatch."
        }
    
        set parent [lindex [info level [expr {[info level] - 1}]] 
    0]
    
        # should print "::test::A::procC" or "procC"
        puts stdout "parent ([info level] - 1) == $parent"
    
        if {[string match "*procC" $parent]} then {
          puts stdout "SUCCESS, parent proc match."
        } else {
          puts stdout "FAILURE, parent proc mismatch."
        }
      }
    }
    
    
    foreach this_interp [list 0 1] {
      puts stdout "Running test with use_new_interp set to 
    $this_interp."
    
      if {$this_interp} then {
        set i [interp create]
        
        interp eval $i {
          namespace eval ::test::A {
            proc procC {} {
              procB
            }    
          }
        }
      } else {
        namespace eval ::test::A {
          proc procC {} {
            procB
          }    
        }
      }
      
      ::test::procA $this_interp
    }
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "mistachkin"
  9. subsystem changed to: "20. [interp]"
  10. title changed to: "[interp alias] problem..."
  11. type changed to: "Bug"