Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: dc1f5007a0a6e23d37d8d83e2f3450f1175b60fc
Ticket: 1080627fffffffffffffffffffffffffffffffff
unpredictable env+upvar
User & Date: nobody on 2004-12-07 13:48:29
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    See comp.lang.tcl 2004-12-06 "very weird effect!".
    ---------------------------
    proc myapp {bn} { upvar 1 $bn b; append b xx }
    set env(XY) aa
    
    myapp env(XY)
    #puts "$env(XY)"
    #append env(XY) yy
    
    puts "$env(XY)"
    ----------------------------
    As is, it writes just "aa"
    If you only uncomment the append-line
      then it writes "aaxxyy"
    If you then also uncomment the puts-line between
      myapp and append, then the "xx" is lost,
      and the script will just write "aa" and "aayy"
    - Very, weird, indeed.
    -----------------------------
    Tested on:
         WindowsXP + Tcl8.4.8
    and by Andreas Leitgeb on:
         tcl8.4.7 and with CVS-version 8.5 on linux
    
  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: "nobody"
  9. subsystem changed to: "None"
  10. title changed to: "unpredictable env+upvar"
  11. type changed to: "Bug"