Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 89f7b1b06ac5119116f808cf5db16b1da9597d07
Ticket: 2774581fffffffffffffffffffffffffffffffff
cross-interp alias uplevel behaviour
User & Date: cnassau on 2009-04-19 16:55:51
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The following doesn't feel right:
    
        interp create other
        other eval {
            proc myforeach {var script} {
                upvar 1 $var v
                foreach v {1 2 3} {
                    uplevel 1 $script
                }
            }
            set myvar myvar-remote
            myforeach stuff {
                puts remote,$myvar,$stuff
            }
        }
        interp alias {} myforeach other myforeach
        set myvar myvar-main
        myforeach stuff {
            puts main,$myvar,$stuff
        }
    
    The output is 
    
       remote,myvar-remote,1
       remote,myvar-remote,2
       remote,myvar-remote,3
       main,myvar-remote,1
       main,myvar-remote,2
       main,myvar-remote,3
    
    Here $myvar is taken from interpreter "other" in both cases: I would have expected "main,myvar-main,1..3" in the second three lines.
    
  4. foundin changed to: "obsolete: 8.5.7"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "cnassau"
  10. subsystem changed to: "22. [proc] and [uplevel]"
  11. title changed to: "cross-interp alias uplevel behaviour"
  12. type changed to: "Bug"