Tcl Source Code

View Ticket
Login
Ticket UUID: 1185933
Title: clock scan invalidates variable
Type: Bug Version: obsolete: 8.5a2
Submitter: uring Created on: 2005-04-19 13:04:11
Subsystem: 06. Time Measurement Assigned To: kennykb
Priority: 7 High Severity:
Status: Closed Last Modified: 2005-04-19 22:12:15
Resolution: Fixed Closed By: kennykb
    Closed on: 2005-04-19 15:12:15
Description:
Using "clock scan"  invalidates variable "i":

EXAMPLE:

run tclsh:

% info patchlevel
8.5a2
% set i 1
1
% clock scan 1
1113865200
% set i
can't read "i": no such variable

NOTES:

(a) same with variable named "j", but not with "a", for
example
(b) repeat "set i ... etc." and variable i seems to be
stable

Rather strange, isn't it.
User Comments: kennykb added on 2005-04-19 22:12:15:
Logged In: YES 
user_id=99768

"That's not a bug, that's a feature".  Well, it's a MISfeature.
To quote Miguel Sofer this morning:
miguelif even *you* fall for it ... lets kill the sucker! I
hate it hate it hate it hate it ...

Thanks for reporting this.

nobody added on 2005-04-19 22:01:02:
Logged In: NO 

It's caused by line 267

 unset i j

in library/clock.tcl

The question is, why does this affect the global variable given 
that it is in a "namespace eval ::tcl::clock { ... }"