Syntax: listinsert (LIST <list>, <value> [, INT <index>]) => list
listappend (LIST <list>, <value> [, INT <index>]) => list
These functions return a copy of <list> with <value> added as a new element. `listinsert()' and `listappend()' add <value> before and after (respectively) the existing element with the given <index>, if provided.
The following three expressions always have the same value:
If <index> is not provided, then `listappend()' adds the <value> at the end of the list and `listinsert()' adds it at the beginning; this usage is discouraged, however, since the same intent can be more clearly expressed using the list-construction expression, as shown in the examples below.