v/vlib/arrays/arrays.v

10 lines
127 B
V
Raw Normal View History

2019-10-30 14:21:57 +01:00
module arrays
2019-12-25 13:52:27 +01:00
pub fn range<T>(start, end T) []T {
mut res := []T
for i := start; i < end; i++ {
2019-10-30 14:21:57 +01:00
res << i
2019-12-25 13:52:27 +01:00
}
2019-10-30 14:21:57 +01:00
return res
2019-12-25 13:52:27 +01:00
}