[swift-evolution] [Review] SE-0094: Add sequence(initial:next:) and sequence(state:next:) to the stdlib

Kevin Ballard kevin at sb.org
Thu May 19 18:42:22 CDT 2016


On Thu, May 19, 2016, at 04:20 PM, Trent Nadeau via swift-evolution wrote:
> Also note that there's a typo in the second example:
>
> for view in sequence(initial: someView, next: { $.superview }) {  //
> someView, someView.superview, someView.superview.superview, ... }
>
> should be:
>
> for view in sequence(state: someView, next: { $.superview }) {  //
> someView, someView.superview, someView.superview.superview, ... }
 
The code as written is correct. The rewritten version would actually
just emit [someView.superview, someView.superview, someView.superview,
...] forever. I imagine the confusion stems from the fact that there's 2
examples but they both demonstrate just the first function, and there's
no examples of the second function, which is something I'll try to
address soon.
 
-Kevin Ballard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160519/d8f76687/attachment.html>


More information about the swift-evolution mailing list