info exist in tcl8.4 fails
Closed / Invalid503739ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-01-15 07:16:41
set abc(0) 1 if [info exist abc(1)] [unset abc(1)] This code fails in tcl8.4.
dkfplain2002-01-15 16:07:43
Logged In: YES
user_id=79902
This is *correct* behaviour according to Tcl's basic
evaluation rules (as detailed in the Tcl(n) manpage.) The
key problem with the code as written is that the unset
command is surrounded by the wrong kind of brackets; the
following works as intended:
if [info exist abc(1)] {unset abc(1)}
If the code in the report ever failed to error (without
abc(1) previously being set to something) then that would
constitute a bug.
Log in (anonymous is fine) to add a comment.