aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-List.by.3
blob: 5f114df840d4337beb858eea310cdfa304560395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH List.by 3 2025-11-29 "Tomo man-pages"
.SH NAME
List.by \- slice by a step value
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI List.by\ :\ func(list:\ [T],\ step:\ Int\ ->\ [T])
.fi
.SH DESCRIPTION
Creates a new list with elements spaced by the specified step value.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
list	[T]	The original list. 	-
step	Int	The step value for selecting elements. 	-
.TE
.SH RETURN
A new list with every `step`-th element from the original list.

.SH EXAMPLES
.EX
assert [1, 2, 3, 4, 5, 6].by(2) == [1, 3, 5]
.EE
.SH SEE ALSO
.BR Tomo-List (3)