aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-List.insert_all.3
blob: d6fa8dc464b4b8913b9c865a0965318c10119136 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH List.insert_all 3 2025-04-21 "Tomo man-pages"
.SH NAME
List.insert_all \- add multiple items to a list
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI List.insert_all\ :\ func(list:\ @[T],\ items:\ [T],\ at:\ Int\ =\ 0\ ->\ Void)
.fi
.SH DESCRIPTION
Inserts a list of items at a specified position in the list.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
list	@[T]	The mutable reference to the list. 	-
items	[T]	The items to be inserted. 	-
at	Int	The index at which to insert the item. 	0
.TE
.SH RETURN
Nothing.

.SH NOTES
Since indices are 1-indexed and negative indices mean "starting from the back", an index of `0` means "after the last item".

.SH EXAMPLES
.EX
list := [10, 20]
list.insert_all([30, 40])
>> list
= [10, 20, 30, 40]

list.insert_all([99, 100], at=2)
>> list
= [10, 99, 100, 20, 30, 40]
.EE