(38 lines)
1 '\" t2 .\" Copyright (c) 2026 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH List.heap_pop 3 2026-03-08 "Tomo man-pages"6 .SH NAME7 List.heap_pop \- heap pop8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI List.heap_pop\ :\ func(list:\ @[T],\ by:\ func(x,y:&T->Int32)\ =\ T.compare\ ->\ T?)13 .fi14 .SH DESCRIPTION15 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.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx lb23 l l l l.24 Name Type Description Default25 list @[T] The mutable reference to the heap. -26 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.compare27 .TE28 .SH RETURN29 The removed top element of the heap or `none` if the list is empty.31 .SH EXAMPLES32 .EX33 my_heap := &[30, 10, 20]34 my_heap.heapify()35 assert my_heap.heap_pop() == 1036 .EE37 .SH SEE ALSO38 .BR Tomo-List (3)