main
Download
38 lines 948 BGroffModified 2026-03-09 raw
1234567891011121314151617181920212223242526272829303132333435363738
'\" t
.\" Copyright (c) 2026 Bruce Hill
.\" All rights reserved.
.\"
.TH List.heap_pop 3 2026-03-08 "Tomo man-pages"
.SH NAME
List.heap_pop \- heap pop
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI List.heap_pop\ :\ func(list:\ @[T],\ by:\ func(x,y:&T->Int32)\ =\ T.compare\ ->\ T?)
.fi
.SH DESCRIPTION
Removes and returns the top element of a heap or `none` if the list is empty. By default, this is the *minimum* value in the heap.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
list	@[T]	The mutable reference to the heap. 	-
by	func(x,y:&T->Int32)	The comparison function used to determine order. If not specified, the default comparison function for the item type will be used. 	T.compare
.TE
.SH RETURN
The removed top element of the heap or `none` if the list is empty.

.SH EXAMPLES
.EX
my_heap := &[30, 10, 20]
my_heap.heapify()
assert my_heap.heap_pop() == 10
.EE
.SH SEE ALSO
.BR Tomo-List (3)