I'm looking for a way to do the equivalent of
for token in "fooXbarXfuzXbuz".split($X):
echo token
but with a file or a stream. It's conceptually similar to readLine, I want to read chunks from a stream until a specified delimiter occurs without reading everything into memory as with the example above.
I know I could write my own iterator based on readData, but is a short and sweet way to do it, preferably but not necessarily within stdlib? Thanks!
Thanks for your very comprehensive answer!
Of course it would be ideal to have a pure nim getdelim, but...
iterator memSlices
This will do nicely!!!