[swift-users] 2 x lazy collection bugs

Jens Alfke jens at mooseyard.com
Tue Feb 9 00:26:53 CST 2016


> On Feb 8, 2016, at 9:28 PM, Howard Lovatt via swift-users <swift-users at swift.org> wrote:
> 
> Not sure where it says that it won't be sequential - do you have a reference? 
…
> Not sure where it says it can be called more than one - the filter might be a very expensive operation like a database lookup!

I think it’s more that the documentation doesn’t specify sequential ordering, and that it doesn’t say the closure is only called once … so you can’t assume that those conditions are true. You’re just inferring that they are, based on your intuition about the implementation.

—Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160208/8670e97e/attachment.html>


More information about the swift-users mailing list