List Insert
Inserts one value into an existing list variable. Use `where` to insert at the `END`, at the `START`, before a zero-based `INDEX`, or before a zero-based `FROM_END` position. If `where` is omitted, the block defaults to `END`. The `index` input is only used for `INDEX` and `FROM_END`. Out-of-range indices throw an error, and `FROM_END` cannot be used on an empty list.
Inputs
| Input | Required | Value Kind | Types | Enum Values |
|---|---|---|---|---|
name | yes | string | — | — |
value | yes | expression | — | — |
where | no | expression | enum-string | END, START, INDEX, FROM_END |
index | no | expression | number | — |
Notes
- Mutating statement for inserting one value into a list variable.
wheremodes:END: append to the end.START: prepend at the start.INDEX: insert before zero-based index from start;indexmay be equal to list length.FROM_END: insert before the element at zero-based position from end (index=0means before last element).
- If
whereis omitted, behavior defaults toEND. indexis only used forINDEXandFROM_END.listPushremains available as a convenience alias forlistInsert(where=END).
Examples
Traverse Nested Sequences With Deduped Worklist
Traverses the active sequence and nested sequences through a pending/seen worklist so nested sequence refs are not processed twice.
Topics: sequence traversal, nested sequences, clip iteration, lists
Source: patterns/ex-sequence-traverse-nested-deduped.json