|
2026-10-11
| ||
| 12:46 | • Ticket [bd2656d8e3] unset fails for declared-only namespace vars, but removes de... artifact: 40f9274f39 user: serhiy.storchaka | |
|
2016-10-28
| ||
| 13:07 | • New ticket [bd2656d8e3]. artifact: 21160e9f8f user: Martin0815 | |
unset fails for declared-only namespace vars, but removes declaration
Openbd2656d8e352ecc5e48545542716c65441ea494fCreated 10 years agoUpdated 53 days ago
Descriptionplain2016-10-28 13:07:10
The "unset" command used on a namespace variable, which hasn't a value assigned, causes correctly an error, claiming the variable does not exist.
The declaration of the namespace variable, existing before using "unset", will be removed by using **unset**.
Here an example script:
% namespace eval a { variable A }
% info vars a::*
a::A
% info exists a::A
0
% unset a::A
can't unset "::a::A": no such variable
% info vars a::*
%
In my opinion the "unset" command should have no side effects, if a variable does not exist!
Nothing is to be changed, if a variable to be unset does not exist, even if a declaration exist, this should not be touched, or the **unset** command should be changed to do not through an error.
Or otherwise its documentation should be extended to document this side effect.
serhiy.storchaka Ticket [bd2656d8e3]: 1 change
[History diff]2026-10-11 12:46:19
Log in (anonymous is fine) to add a comment.