Is drop/skip the same as a seek (like in a file) i...
# stdlib
a
Is drop/skip the same as a seek (like in a file) in a sequence? Any way to support seeking to a particularl location instead of doing a noop loop
i
In general, no. Sequences are forward-only and sequential.
Theoretically, you could create a wrapper, but it would have to memoize the source sequence entirely to support random access seek.
a
Right, at which point might as well just use an array/list
z
There is a MemoizedSequence impl in the KSP plugin if you're interested. There's benefits to lazy eval
a
Will check that out thx