dev
Download
45 lines 899 BGroffModified 2026-03-09 raw
123456789101112131415161718192021222324252627282930313233343536373839404142434445
'\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH List.remove_item 3 2026-03-08 "Tomo man-pages"
.SH NAME
List.remove_item \- remove an item by value
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI List.remove_item\ :\ func(list:\ @[T],\ item:\ T,\ max_count:\ Int\ =\ -1\ ->\ Void)
.fi
.SH DESCRIPTION
Removes all occurrences of a specified item from 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. 	-
item	T	The item to be removed. 	-
max_count	Int	The maximum number of occurrences to remove. 	-1
.TE
.SH RETURN
Nothing.

.SH NOTES
A negative `max_count` means "remove all occurrences".

.SH EXAMPLES
.EX
list := &[10, 20, 10, 20, 30]
list.remove_item(10)
assert list == [20, 20, 30]

list.remove_item(20, max_count=1)
assert list == [20, 30]
.EE
.SH SEE ALSO
.BR Tomo-List (3)