Brilliant! Very kind of you. Thanks!
The idiomatic way to do this is to use an iterator. The
[itertools](https://github.com/narimiran/itertools) library has this iterator
under the name `islice`. Here is how the implementation for `take` would look
anyway:
var lst = @[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
iterator t
Awesome. Thanks for your answer!
Its [0 ..< 5]
You want slicing:
[https://narimiran.github.io/nim-basics/#_indexing_and_slicing](https://narimiran.github.io/nim-basics/#_indexing_and_slicing)
See here:
[https://play.nim-lang.org/#ix=2bFa](https://play.nim-lang.org/#ix=2bFa)
Being new to Nim I'm missing basic list/sequence functions like e.g. take.
var lst = @[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for n in lst.take(5)
echo n
# 1
# 2
# 3
# 4
# 5
Run
I would also assume that there would be an iterator but I couldn't fin