|
2004-05-26
| ||
| 02:48 | • Ticket [736729ffff] variable name resolution broken status still Closed with... artifact: 6b93d2a213 user: msofer | |
|
2004-05-24
| ||
| 03:11 | • Closed ticket [736729ffff]. artifact: dff52e6b94 user: msofer | |
|
2004-05-22
| ||
| 22:29 | • Ticket [736729ffff]: 4 changes artifact: 9a3a986599 user: msofer | |
| 16:42 | • Ticket [736729ffff]: 6 changes artifact: 83a5a356be user: msofer | |
| 16:36 | • Ticket [736729ffff]: 4 changes artifact: d0eb7b4919 user: msofer | |
| 10:43 | • Ticket [736729ffff]: 4 changes artifact: 138df82476 user: msofer | |
|
2004-03-27
| ||
| 11:10 | • Ticket [736729ffff]: 4 changes artifact: 8321a13e9f user: msofer | |
|
2003-06-28
| ||
| 02:15 | • Ticket [736729ffff]: 1 change artifact: c31a1e4c8f user: dgp | |
|
2003-05-14
| ||
| 21:12 | • Ticket [736729ffff]: 1 change artifact: 35ee71e313 user: dgp | |
|
2003-05-13
| ||
| 06:06 | • Ticket [736729ffff]: 4 changes artifact: 7e9bd8d1ed user: msofer | |
|
2003-05-12
| ||
| 22:48 | • New ticket [736729ffff]. artifact: 9f7ca21269 user: msofer | |
variable name resolution broken
Closed / Postponed736729ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 23 years ago
Descriptionplain2003-05-12 22:48:05
Name resolution is slightly broken in 8.4. % set x 1 1 % unset x % namespace eval test set x 0 0 % set x 0 Note that the temporary fix of [Bug 735335] solves this issue - for 8.4.3 and in HEAD: the result is as it should be: can't read "x": no such variable
msoferplain2003-05-13 06:06:44
Logged In: YES user_id=148712 I have not managed to devise a test for this yet; the error seems to depend on some subtle interplay with the literal mechanism. It is triggered at the tclsh prompt, but apparently not in a sourced file (pure string evaluation) or a proc body (pure compilation).
dgp Ticket [736729ffff]: 1 change
[History diff]2003-05-14 21:12:21
dgp Ticket [736729ffff]: 1 change
[History diff]2003-06-28 02:15:27
msoferplain2004-03-27 11:10:58
Logged In: YES user_id=148712 Weird stuff - something to do with literals? If we replace the variable name 'x' by 'y', there is no bug!!!
msoferplain2004-05-22 10:43:16
Logged In: YES user_id=148712 Bug 735335 isnow fixed, but this one still lives ...
msoferplain2004-05-22 16:36:13
Logged In: YES user_id=148712 Thebug is not in the obj type, but rather in the lookup mechanism. The bug is still present in HEAD with the temporary fix; a script that exposes it is % namespace eval a upvar x q % namespace eval b set x 0 0 % set x 0 What is happening in the original script is: - x is a shared literal (created by init.tcl) - 'set x 1; unset x' shimmers x to tclNsVarNameType - the shared literal keeps an (undefined) variable x in the global hashtable - the lookup mechanism finds the variable in the hashtable, and uses it In this new version, x is kept in the hashtable by upvar instead.
msoferplain2004-05-22 16:42:51
Logged In: YES user_id=148712 The bug is present since bog knows when - at least 8.3.4 shows the buggy behaviour in the upvar version below ...
msoferplain2004-05-22 22:29:30
Logged In: YES
user_id=148712
More fun with zombie variables - ie, those that have an
entry in the hashtable but (flags & VAR_UNDEFINED) is true:
% namespace eval a {}
% upvar 0 a::q x
% namespace eval a {set x 1; set q}
1
% set x
1
% set a::x
can't read "a::x": no such variable
msoferplain2004-05-24 03:11:07
Logged In: YES user_id=148712 Closing this bug ticket - the bug introduced in tcl8.4 is fixed, 8.4 and 8.5 behave now the same as all previous 8.x (AFAICT). Opening [Bug 959052] for the remaining issues.
msoferplain2004-05-26 02:48:46
Logged In: YES user_id=148712 Cached ns varnames still interfere with name resolution: A cached varName may keep a variable's name in the namespace's hash table, which is the resolver's criterion for existence (see test namespace-17.10). This caching now disabled, will have to wait until the variable name resolution is fixed.
Log in (anonymous is fine) to add a comment.