Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2b189629c707a33d1af1a3f38c9ceca6c3151409
Ticket: 1242314fffffffffffffffffffffffffffffffff
confusing unset/upvar documentation
User & Date: nobody on 2005-07-21 14:03:14
Changes

  1. assignee changed to: "msofer"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Sorry but I cannot test this now with newer releases.
    
    From the [upvar] manual page:
    
           "If an upvar variable is unset [...] the  unset
     operation
            affects  the  variable it is linked to, not the
    upvar
            variable.  There is no way to unset an upvar
    variable
            except by exiting the procedure in  which it is
            defined."
    
    Playng with tclsh:
    
     /usr/local/bin/tclsh 8.4 (marco) % set tcl_version
    8.4
    /usr/local/bin/tclsh 8.4 (marco) % info patchlevel
    8.4.8
    /usr/local/bin/tclsh 8.4 (marco) % set a 1
    1
    /usr/local/bin/tclsh 8.4 (marco) % proc p {} { upvar a
    b ; puts $b ; unset b }
    /usr/local/bin/tclsh 8.4 (marco) % p
    1
    /usr/local/bin/tclsh 8.4 (marco) % set a
    can't read "a": no such variable
    /usr/local/bin/tclsh 8.4 (marco) % 
    
    Ciao.
    
    
  4. foundin changed to: "obsolete: 8.4.8"
  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: "07. Variables"
  10. title changed to: "usetting upvar alias unsets upvar variable"
  11. type changed to: "Bug"