prepend(x, L)
|
|
|
The new list will be of the same class as L.
|
|
Only a single element can be prepended with this function. To prepend the elements of a list, use join. To add the new element to the end of the list, or at a particular index, use append or insert, respectively.
|
|
|
Prepend always returns a new list, rather than modifying the input list, even if L is a MutableList.
|
|
|
Notice that the order of the arguments is switched in prepend versus append: we write prepend(x, L) and append(L, x). A good way to remember this is that the new element is visually placed before or after the list, depending on where we want it to appear in the output.
The object prepend is a compiled function.
The source of this document is in Macaulay2Doc/functions/prepend-doc.m2:54:0.