Lists

concat list [list ...]
Concatenates multiple lists into a single lists. Each element of each list become an element of the new one.
Returns the list.
Example:
% set L1 {a b {c d} e}
% set L2 {f g {h i}}
% concat $L1 $L2
a b {c d} e f g {h i}
join list [joinString]
Joins the elements of a list into one single string using joinString as separator (default: one space).
Returns the string.
Example:
% set L1 { {} home username public_html rtda {} }
% join L1 /
/home/username/public_html/rtda/               
# note what happened to the two {}
lappend list value [value ...]
Appends each value to the current list as a new list element.
Returns the list.
Creates a new list if it doesn't exist.
Example:
% set fullpath { {} home }
% set user { username }
% set folder { public_html rtda {} }
% lappend fullpath $user $folder
{} home { username } { public_html rtda {} }
lindex list index
Returns the index'th element of the list. The first element has index 0. The last can be accessed using the symbol ``end''.
list [value ...]
Concatenates the arguments to make a new list. Each argument becomes an element of the new list.
Returns the list.
Example:
% set L1 {a b {c d} e}
% set L2 {f g {h i}}
% list $L1 $L2
{a b {c d} e} {f g {h i}}
llength list
Returns the number of elements in the list.
split string [splitChars]
Returns a list formed by splitting string at instances of splitChars and turning the characters between these instances into list elements.
Example:
% set fullPath "/home/username/public_html/rtda/read.me"
% split $fullPath /
{} home username public_html rtda read.me      ;# note the {}