Skip to content
Tcl Source Code History Of Ticket 967565
Login

History Of Ticket 967565

Artifacts Associated With Ticket 967565

  1. Ticket change [06462983f8] (rid 89195) by mistachkin on 2004-06-06 12:15:51:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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 initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "mistachkin"
    9. subsystem initialized to: "20. [interp]"
    10. title initialized to: "[interp alias] problem..."
    11. type initialized to: "Bug"
  2. Ticket change [100fafec97] (rid 94904) by mistachkin on 2004-06-06 19:17:27:

    1. icomment:
      
      
      File Added - 89675: test.tcl
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  3. Add attachment "test.tcl" [b41e613949] (rid 124969) by mistachkin on 2004-06-06 19:17:27.

  4. Ticket change [6346d17951] (rid 92547) by mistachkin on 2004-06-07 05:37:16:

    1. icomment:
      
      
      File Added - 89728: call-stack.tcl
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  5. Add attachment "call-stack.tcl" [3dbf1f1d0e] (rid 121144) by mistachkin on 2004-06-07 05:37:16.

  6. Ticket change [8f958d5333] (rid 120299) by mistachkin on 2004-06-08 04:31:52:

    1. foundin changed to: "obsolete: 8.4.6"
  7. Ticket change [6fb48d1e2c] (rid 100359) by dgp on 2004-06-08 04:47:43:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      It's probably fair to say this
      is underdocumented.
      
      [info level] does not trace back
      through the caller sequence,
      weaving in and out of interps.
      Instead, it reports the stack
      of CallFrame's for the current
      interp only.
      
      This is intentional, though you
      may need to consult with the
      original [interp] creators to get
      a best explanation of the reasons
      why.  If Jacob Levy is available,
      he might be able to fill in more
      details.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. title changed to:
      [info level] reports current interp's CallFrames only
      
    5. username: "dgp"
  8. Ticket change [9877f1f4ba] (rid 110606) by dgp on 2004-06-08 04:56:38:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      Note that the "level"s reported
      on by [info level] are the same
      ones which govern [uplevel] and
      [upvar].  That might explain
      why only the current interp's
      CallFrames are tracked.  You would
      not want an [uplevel] to cause 
      substitution/evaluation in a different
      interp.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  9. Ticket change [706a6ecbab] (rid 100476) by mistachkin on 2004-06-08 05:26:52:

    1. icomment:
      Logged In: YES 
      user_id=113501
      
      Actually, such a feature might be desirable in some 
      circumstances (primarily when a safe interp calls a proc in a 
      master interp that needs to modify variables in the calling 
      child proc via upvar, etc).
      
      
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  10. Ticket change [375cb490d9] (rid 107258) by dkf on 2004-06-09 04:22:37:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      It's possibly the case that we need [interp set], but it is
      usually not to big a problem in practice.
      
      Inter-interp [upvar] is deeply evil.  I don't want to be
      that scared.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  11. Ticket change [98fc72b859] (rid 110702) by mistachkin on 2005-08-01 09:21:13:

    1. foundin changed to: "obsolete: 8.5a3"
  12. Ticket change [d7256953ad] (rid 123931) by mistachkin on 2005-08-01 09:21:15:

    1. icomment:
      Logged In: YES 
      user_id=113501
      
      
      Since this appears to be by design, perhaps we can address
      it in the 9.0 timeframe (maybe with an optional arguments
      that allow you to "escape" out of the child interp, if the
      master allows it):
      
      interp set varName ?value?
      info level ?level? ?list_of_interps?
      
      etc
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. priority changed to: "1 Zero"
    5. username: "mistachkin"