blob: 9cfbdcd4688969fdb458a9d0a284b164be6f5527 (
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.remove_at 3 2025-09-06 "Tomo man-pages"
.SH NAME
List.remove_at \- remove an item by index
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI List.remove_at\ :\ func(list:\ @[T],\ at:\ Int\ =\ -1,\ count:\ Int\ =\ 1\ ->\ Void)
.fi
.SH DESCRIPTION
Removes elements from the list starting at a specified index.
.SH ARGUMENTS
.TS
allbox;
lb lb lbx lb
l l l l.
Name Type Description Default
list @[T] The mutable reference to the list. -
at Int The index at which to start removing elements. -1
count Int The number of elements to remove. 1
.TE
.SH RETURN
Nothing.
.SH NOTES
Since negative indices are counted from the back, the default behavior is to remove the last item.
.SH EXAMPLES
.EX
list := [10, 20, 30, 40, 50]
list.remove_at(2)
>> list
= [10, 30, 40, 50]
list.remove_at(2, count=2)
>> list
= [10, 50]
.EE
|