> On Jun 30, 2016, at 10:26 AM, Dave Abrahams via swift-evolution
> <[email protected]> wrote:
>
> It would
> be very interesting to know about any real-world models of single-pass
> sequences that people are using in Swift, since we don't supply any in
> the standard library.
>
> --
> Dave
I already gave an example of this earlier in the thread:
>> I use it in a LazyRowSequence<T: SqlModelConvertible> where querying Sqlite
>> in WAL mode allows multiple concurrent readers to get point-in-time
>> snapshots of the database. The query can’t be replayed without buffering all
>> the rows in memory because Sqlite’s step functions are not bi-directional.
>> In some cases we are talking about tens of thousands of rows (or even
>> hundreds of thousands) and the ability to avoid buffering them is a feature,
>> not a bug.
IMHO the typical case for single-pass is IO. In this case it would work just as
well as LazyRowIterator<T> assuming the language allows for-in on an iterator.
Russ
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution