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:
The listPtr object must not be shared when calling, as this function will modify it.