Tcl_ListObjReplace

One of the basic list-manipulation functions in the C API to the Tcl C Library. Does most of the work for both linsert and lreplace.

Documentaton at https://www.tcl-lang.org/man/tcl8.5/TclLib/ListObj.htm .

Prototype:

int Tcl_ListObjReplace(Tcl_Interp *interp, Tcl_Obj *listPtr, int first, int count, int objc, Tcl_Obj *const objv[])

The listPtr object must not be shared when calling, as this function will modify it.