beetlebug▾
/

tsv llength

Gives the count of elements of a list in a shared array.

tsv::llength ARRAY ELEMENT

Description

The command tsv::llength gives the count of elements of the list in the element.

Arguments

ArgumentTypeDefaultDescription
ARRAYarray namerequiredThe name of the shared array.
ELEMENTstringrequiredThe name of the element.

Returns

A non-negative integer.

Examples

% tsv::set l x {a b c}
> tsv::llength l x
3

% tsv::set l e {}
> tsv::llength l e
0

Errors

% tsv::llength l
wrong # args: should be "tsv::llength array key ?args?"
-errorcode TCL WRONGARGS

% tsv::set l x {a b c}
> tsv::llength l nope
no key l(nope)
-errorcode NONE

Facts

Capability
thread. A new interpreter does not have it until the host turns it on.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also