lreplace(n) Tcl Built-In Commands lreplace(n) _________________________________________________________________ NAME lreplace - Replace elements in a list with new elements SYNOPSIS lreplace _l_i_s_t _f_i_r_s_t _l_a_s_t ?_e_l_e_m_e_n_t _e_l_e_m_e_n_t ...? _________________________________________________________________ DESCRIPTION Lreplace returns a new list formed by replacing one or more elements of _l_i_s_t with the _e_l_e_m_e_n_t arguments. _F_i_r_s_t gives the index in _l_i_s_t of the first element to be replaced (0 refers to the first element). If _f_i_r_s_t is less than zero then it refers to the first element of _l_i_s_t; the element indicated by _f_i_r_s_t must exist in the list. _L_a_s_t gives the index in _l_i_s_t of the last element to be replaced. If _l_a_s_t is less than _f_i_r_s_t then no elements are deleted; the new elements are simply inserted before _f_i_r_s_t. _F_i_r_s_t or _l_a_s_t may be end (or any abbreviation of it) to refer to the last element of the list. The _e_l_e_m_e_n_t arguments specify zero or more new arguments to be added to the list in place of those that were deleted. Each _e_l_e_m_e_n_t argument will become a separate element of the list. If no _e_l_e_m_e_n_t arguments are specified, then the elements between _f_i_r_s_t and _l_a_s_t are sim- ply deleted. KEYWORDS element, list, replace Tcl Last change: 7.4 1