beetlebug▾
/

tsv lappend

Adds elements to the end of a list in a shared array.

tsv::lappend ARRAY ELEMENT VALUE ?VALUE ...?

Description

The command tsv::lappend adds each VALUE as an element to the end of the list in the element, and gives the new list. An element that does not exist starts as an empty list. The list grows in place, so each call is amortized constant time.

Arguments

ArgumentTypeDefaultDescription
ARRAYarray namerequiredThe name of the shared array.
ELEMENTstringrequiredThe name of the element.
VALUEstringrequiredAn element to add.

Returns

The new list.

Examples

% tsv::lappend l x a
a

% tsv::lappend l2 x a
> tsv::lappend l2 x b {c d}
a b {c d}

Errors

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

% tsv::lappend l x
wrong # args: should be "tsv::lappend l x value ?value ...?"
-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