This is similar to the readLine procedure for the Stream type in
the stdlib, except working on slices.
The implementation is obviously directly based on the mSlices iterator. Initially I wanted to base one on the other, but I decided against it for now. This way I can add a nil check in nextSlice and don't need to shadow the input mslc argument in mSlices to have a slice that we advance for each yielded slice.
This is similar to the
readLine
procedure for theStream
type in the stdlib, except working on slices.The implementation is obviously directly based on the
mSlices
iterator. Initially I wanted to base one on the other, but I decided against it for now. This way I can add anil
check innextSlice
and don't need to shadow the inputmslc
argument inmSlices
to have a slice that we advance for each yielded slice.