beetlebug▾
/

namespace qualifiers

Gives the part of a name before its last ::.

namespace qualifiers STRING

Description

Gives the text of STRING before the last ::, the namespace part of a name. A name with no ::, or with only a :: at the start, gives an empty string. It reads the text only: the namespace need not exist.

Arguments

ArgumentTypeDefaultDescription
STRINGstringrequiredA name.

Returns

The namespace part of the name, or an empty string.

Examples

% namespace qualifiers ::a::b::c
::a::b

% namespace qualifiers a::b
a

% namespace qualifiers ::a

% namespace qualifiers a

Errors

% namespace qualifiers
wrong # args: should be "namespace qualifiers string"
-errorcode TCL WRONGARGS

Facts

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

See also