it has some implications we wanted to avoid. First...
# announcements
o
it has some implications we wanted to avoid. First, you can only produce Iterable, because you don’t know the resulting size before you filter. Second, it captures predicates and potentially produce memory leaks. Seen that a lot in my C# days. Third, it is view, so if you apply a filter and then modify original list, it is seen through, which is often undesirable. So we decided to make operations as snapshots for Iterables (lists, sets,etc) and make them lazy for special type
Sequence
. Performance wise it is the same for small lists (majority of all lists), and when you need it lazy, you can always call
asSequence()
on it