dict remove

Gives a copy of a dict with some keys removed.

dict remove DICT ?KEY ...?

Description

Gives DICT with no KEY in it. A KEY that is not in DICT is no error. The keys are of the top level only: there is no path.

Arguments

ArgumentTypeDefaultDescription
DICTdictrequiredThe dict.
KEYstringnoneA key to remove.

Returns

The new dict.

Examples

% dict remove {a 1 b 2 c 3} a c
b 2

% dict remove {a 1} zz
a 1

Errors

% dict remove {a}
missing value to go with key
-errorcode NONE

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also