Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2000-10-26
08:32 • Closed ticket [218962ffff]: vwait and variable don't like each other... artifact: caebe4ea9d user: welch
01:08 • New ticket [218962ffff]. artifact: 32f982eb32 user: nobody

[vwait] and [variable] don't like each other

Closed / Fixed218962ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:08:40
OriginalBugID: 3329 Bug
Version: 8.2
SubmitDate: '1999-11-05'
LastModified: '2000-01-19'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: All
FixedDate: '2000-01-19'
FixedInVersion: 8.3
ClosedDate: '2000-10-25'


Name:
keith lea

ReproducibleScript:
namespace eval f {
        proc unwait {} {
            variable test
    
            puts "unwaiting"
            set test 1
            puts "unwaited"
        }
    
        proc wait {} {
            variable test
    
            puts "waiting"
            vwait test
            puts "waited"
        }
    
        proc print {} {
            variable test
    
            puts $test
        }
    }
    
    after idle f::wait
    after idle f::unwait
    return

ObservedBehavior:
test.tcl is the included script..
    
    % source test.tcl
    waiting
    unwaiting
    unwaited
    % f::print
    1
    % 
    
    in other words, the [vwait] inside the [f::wait] procedure never
    returns, even though $f::test is set (as the [f::print] call states)

DesiredBehavior:
the vwait should work with namespace variables linked to local variables
    inside procs using [variable]
    
    if I edit the [vwait] to say [vwait f::test] it works. there is nothing
    in the documentation stating that vwait waits for variables on level #0.
    does it?



This is a documentation failure (the vwait docs haven't changed
since 7.5, and namespaces were added in 8.0).  vwait does require
a globally scoped variable.  The reason for this is that we want
to ensure that the user does not provide us a local var (that
could never get set again).  The docs have been updated for 8.3. 
-- 01/19/2000 hobbs
welch Closed ticket [218962ffff]. [History diff]2000-10-26 08:32:15
Log in (anonymous is fine) to add a comment.