beetlebug▾
/

tsv lrange

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

tsv::lrange ARRAY ELEMENT FIRST LAST

Description

The command tsv::lrange gives the elements from FIRST to LAST of the list in the element, as lrange does. A range with no element gives an empty list.

Arguments

ArgumentTypeDefaultDescription
ARRAYarray namerequiredThe name of the shared array.
ELEMENTstringrequiredThe name of the element.
FIRSTindexrequiredThe index of the first element.
LASTindexrequiredThe index of the last element.

Returns

A list.

Examples

% tsv::set l x {a b c}
> tsv::lrange l x 1 end
b c

% tsv::set l x {a b c}
> tsv::lrange l x 5 9

Errors

% tsv::set l x {a b c}
> tsv::lrange l x 0
wrong # args: should be "tsv::lrange l x first last"
-errorcode TCL WRONGARGS

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