Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d500218f9625d338863eed883b429b037014d750
Ticket: 2883036fffffffffffffffffffffffffffffffff
upvar-7.1 leaves irremovable variable
User & Date: nijtmans on 2009-10-21 15:34:31
Changes

  1. icomment:
    The same happens when using namespace variables:
    
    % namespace eval x {upvar 0 x uv;set uv 34}
    34
    % set x::x
    34
    % unset x::x
    % set x::uv
    can't read "x::uv": no such variable
    % namespace eval x {info vars uv}
    uv
    
    Giving it some thoughts, upvar is really only
    meant to be used for local variables. What
    would happen if we changed the documentation
    and the implementation: In case the linkvar is
    a global or a namespace variable, then an
    unset should just remove both. Would any
    test case fail if this was changed? It's
    worth a try, but I guess that it wouldn't
    bother any practical case.
    
    Yes, a TIP is needed for this. Is there
    anyone out there who has a counter
    example of a use case where this
    change would be a problem? If not,
    then I would suggest to change the
    behavior and the implementation.
    
    
  2. login: "nijtmans"
  3. mimetype: "text/plain"
  4. username: "nijtmans"