(39 lines)
1 '\" t2 .\" Copyright (c) 2026 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH List.heap_push 3 2026-03-08 "Tomo man-pages"6 .SH NAME7 List.heap_push \- heap push8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI List.heap_push\ :\ func(list:\ @[T],\ item:\ T,\ by\ =\ T.compare\ ->\ Void)13 .fi14 .SH DESCRIPTION15 Adds an element to the heap and maintains the heap property. By default, this is a *minimum* 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 item T The item to be added. -27 by The comparison function used to determine order. If not specified, the default comparison function for the item type will be used. T.compare28 .TE29 .SH RETURN30 Nothing.32 .SH EXAMPLES33 .EX34 my_heap : &[Int]35 my_heap.heap_push(10)36 assert my_heap.heap_pop() == 1037 .EE38 .SH SEE ALSO39 .BR Tomo-List (3)