Skip to content
Tcl Source Code View Ticket
Login

View Ticket

unset ignores error of trace

Closed / Invalid2968650fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 17 years ago
Descriptionplain2010-03-11 12:59:39
I'm not sure, if this is a bug or not. I would expect an error from the unset command. But nothing happens.
I show you an example:

% proc raise_error { args } { puts $args; error "error" }
% trace add variable a unset raise_error
% set a(1) 1
1
% unset a(1)
a 1 unset
% trace add variable a write raise_error
% set a(2) 1
a 2 write
can't set "a(2)": error
while evaluating {set a(2) 1}
dgpplain2010-03-16 00:06:08
allow_comments - 1


From http://www.tcl.tk/man/tcl/TclCmd/trace.htm#M18 :

"Any errors in unset traces are ignored. "
Log in (anonymous is fine) to add a comment.