diff options
Diffstat (limited to 'man/man3/tomo-List.to.3')
| -rw-r--r-- | man/man3/tomo-List.to.3 | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/man/man3/tomo-List.to.3 b/man/man3/tomo-List.to.3 new file mode 100644 index 00000000..82143c0b --- /dev/null +++ b/man/man3/tomo-List.to.3 @@ -0,0 +1,38 @@ +'\" t +.\" Copyright (c) 2025 Bruce Hill +.\" All rights reserved. +.\" +.TH List.to 3 2025-04-19T14:30:40.361956 "Tomo man-pages" +.SH NAME +List.to \- Returns a slice of the list from the start of the original list up to a specified index (inclusive). + +.SH LIBRARY +Tomo Standard Library +.SH SYNOPSIS +.nf +.BI "List.to : func(list: [T], last: Int -> [T])" +.fi + +.SH DESCRIPTION +Returns a slice of the list from the start of the original list up to a specified index (inclusive). + + +.TS +allbox; +lb lb lbx lb +l l l l. +Name Type Description Default +list [T] The original list. - +last Int The index up to which elements should be included. - +.TE +.SH RETURN +A new list containing elements from the start up to the specified index. + +.SH EXAMPLES +.EX +>> [10, 20, 30, 40, 50].to(3) += [10, 20, 30] + +>> [10, 20, 30, 40, 50].to(-2) += [10, 20, 30, 40] +.EE |
