Skip to content
Tcl Source Code View Ticket
Login

View Ticket

trace creates a variable visible to namespace which but not

Closed / Fixed218540ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:01:55
OriginalBugID: 956 Bug
Version: 8.0.3
SubmitDate: '1998-12-14'
LastModified: '2000-01-26'
Severity: LOW
Status: Released
Submitter: pat
ChangedBy: ericm
OS: All
FixedDate: '2000-01-26'
FixedInVersion: 8.3
ClosedDate: '2000-10-25'


Name:
Tim Wilson

Extensions:
None

CustomShell:
None

ReproducibleScript:
% info exists foo
0
% namespace which -variable foo
(Returns nothing, meaning that variable does not exist.)
% trace variable foo w bar
% info exists foo
0
(I conclude that tracing a non-existent variable doesn't bring it into being.)
% namespace which -variable foo
::foo
(Uh-ho: namespace gives a contradictory answer.)
%

ObservedBehavior:
Tracing a non-existant variable causes info exists and namespace which -variable to give different answers about whether the variable exists.

DesiredBehavior:
Consistency between info exists and namespace which.



This is fixed in 8.3.  The namespace which command was not checking to see if the variable was undefined.

- eric

-- 01/20/2000 ericm

On further investigate, it seems we cannot change this behavior without compromising backwards compatibility.  I have instead amended the documentation to reflect the discrepancy in behaviors.

- eric

-- 01/26/2000 ericm
welch Closed ticket [218540ffff]. [History diff]2000-10-26 08:24:13
Log in (anonymous is fine) to add a comment.