prepend function
A list with an element added at the start.
How to write it
prepend(list, x)
- list
- The list. Takes a list.
- x
- The element to add. Takes an expression.
Examples
prepend([1, 2], 0)In the solver,
Open in the solverprepend([1, 2], 0)gives[0, 1, 2].
Related functions
- range
The whole numbers in a range, as a list.
- position
Where a value occurs in a list, as a list of positions.
- replace_part
A list with the part at a position replaced; write position -> value.
- partition
A list split into blocks of a given length.
- rest
A list without its first element.
- part
Read part of a list by position, counting from 1; also written list[i].