Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
(def items2 (conj items x))
items.Insert(0, x);
items = x ~ items;
items = [x, ...items];
items2 = [x | items]
items = [x, items]
func prepend[S ~[]T, T any](items *S, x ...T) {
*items = append(*items, x...)
copy((*items)[len(x):], *items)
copy(*items, x)
}
func prepend[S ~[]T, T any](items *S, x ...T) {
*items = append(x, *items...)
}
items = append([]T{x}, items...)
items = append(items, x)
copy(items[1:], items)
items[0] = x
f(x:xs)= x:xs
items2 = x : items
items = [x, ...items];
items.unshift(x);
items.add(0, x);
table.insert(items, 1, x)
array_unshift($items, $x);
items.insert(0,x);
unshift @items, $x
items.insert(0, x)
items = [x] + items
items.prepend(x)
items.unshift(x)
val newList = x :: items
items.Insert(0, x)