Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: dbd477c99730f13dea95ef8baa43fd31dda730af
Ticket: 2929546fffffffffffffffffffffffffffffffff
"dict with" binds to varibles outside its scope
User & Date: mpdanielson on 2010-01-11 00:54:40
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Setting a variable inside a "dict with" body changes the value of the dictionary and also changes the value of a variable with the same name outside of the body. In the following sequence, the value of ::a is changed when the value of the entry named "a" in the dictionary "x" is changed. I expected that only the dictionary would be changed.
    (paul) 101 % set tcl_patchLevel
    8.6b1.1
    (paul) 102 % set a A
    A
    (paul) 103 % dict set x a 1
    a 1
    (paul) 104 % set a
    A
    (paul) 105 % set x
    a 1
    (paul) 106 % dict with x {
    set a
    }
    1
    (paul) 107 % dict with x {
    set a 2
    }
    2
    (paul) 108 % set a
    2
    (paul) 109 % set x
    a 2
    
    
  4. foundin changed to: "obsolete: 8.6b1.1"
  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: "mpdanielson"
  10. subsystem changed to: "15. Dict Object"
  11. title changed to: ""dict with" binds to varibles outside its scope"
  12. type changed to: "Bug"