Skip to content
Tcl Source Code History Of Ticket 1242314fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1242314fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1242314fffffffffffffffffffffffffffffffff

  1. Ticket change [2b189629c7] (rid 118678) by nobody on 2005-07-21 14:03:14:

    1. assignee initialized to: "msofer"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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 initialized to: "obsolete: 8.4.8"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "07. Variables"
    10. title initialized to: "usetting upvar alias unsets upvar variable"
    11. type initialized to: "Bug"
  2. Ticket change [eaf24d2156] (rid 103452) by msofer on 2005-07-21 22:13:55:

    1. icomment:
      Logged In: YES 
      user_id=148712
      
      The language may be somewhat confusing ... but what you see
      is precisely what is documented.
      
      When you do 'upvar a b', the docs call b 'the upvar
      variable' (ie, the variable created by the upvar command);
      it is linked to the variable a.
      
      Hence, the docs say that 'unset b' actually unsets a, just
      as you observed.
      
      I'll leave this open and consider it a documentation bug:
      maybe we can come up with a description less likely to
      confuse, or add an example.
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. title changed to: "confusing unset/upvar documentation "
    5. username: "msofer"
  3. Ticket change [782a83c297] (rid 89909) by marcomaggi on 2005-07-27 02:15:28:

    1. icomment:
      Logged In: YES 
      user_id=727156
      
      Fine. I agree with the documentation bug and the need for
      the example. Maybe the code that I used to show it is enough.
      
      I propose two changes:
      
        "If an upvar variable is unset (e.g. x in add2 above),  the
         unset  operation affects the variable it is linked to,
      not the
         upvar variable."
      
      should be:
      
        "If the unset command is invoked with an upvar variable
         as argument (e.g. x in add2 above),  the unset  operation
         affects both the variable it is linked to, and the upvar
         variable."
      
      The phrase:
      
         "There is no way to unset an upvar variable except
          by exiting the procedure in which it is defined.
          However, it is possible to retarget an upvar variable
          by executing another upvar command."
      
      should be:
      
        "There is no way to unlink an upvar variable from the
         linked one without unsetting both, except by exiting the
         procedure in which it is defined or by retargeting the
         upvar variable by executing another upvar command."
      
      
      
      
    2. login: "marcomaggi"
    3. mimetype: "text/plain"
    4. username: "marcomaggi"
  4. Ticket change [a4ee8bfe7a] (rid 110284) by msofer on 2006-03-11 21:12:36:

    1. closedate changed to: "2006-03-11T14:12:36"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      Revisiting after such a long time ...
      
      I do not agree with your reformulations: the unset operation
      does not affect the upvar variable, and it does not destroy
      the link. It just unsets the variable to which the link was
      created. Witness
      
      % set x 1
      1
      % upvar 0 x y
      % set y
      1
      % unset y
      % set x
      can't read "x": no such variable
      % set y 2
      2
      % set x
      2
      
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Pending"
    8. username: "msofer"
  5. Ticket change [200cda891e] (rid 91248) by sf-robot on 2006-03-26 10:21:10:

    1. icomment:
      Logged In: YES 
      user_id=1312539
      
      This Tracker item was closed automatically by the system. It was
      previously set to a Pending status, and the original submitter
      did not respond within 14 days (the time period specified by
      the administrator of this Tracker).
      
      
    2. login: "sf-robot"
    3. mimetype: "text/plain"
    4. status changed to: "Closed"
    5. username: "sf-robot"
  6. Ticket change [939c491fa7] (rid 105847) by sf-robot on 2006-03-26 10:21:11:

    1. closedate changed to: "2006-03-26T03:21:11"
    2. closer changed to: "sf-robot"