(37 lines)
1 '\" t2 .\" Copyright (c) 2025 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH List.to 3 2025-11-29 "Tomo man-pages"6 .SH NAME7 List.to \- slice a list to an end index8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI List.to\ :\ func(list:\ [T],\ last:\ Int\ ->\ [T])13 .fi14 .SH DESCRIPTION15 Returns a slice of the list from the start of the original list up to a specified index (inclusive).18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx23 l l l.24 Name Type Description25 list [T] The original list.26 last Int The index up to which elements should be included.27 .TE28 .SH RETURN29 A new list containing elements from the start up to the specified index.31 .SH EXAMPLES32 .EX33 assert [10, 20, 30, 40, 50].to(3) == [10, 20, 30]34 assert [10, 20, 30, 40, 50].to(-2) == [10, 20, 30, 40]35 .EE36 .SH SEE ALSO37 .BR Tomo-List (3)