<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I think it’s better to take as a reference the <b class="">Go</b> language and his <b class="">goroutines</b> and <b class="">channels</b>.<div class=""><br class=""></div><div class="">Not just to face these type of problems but also to take new architectural aproches to build software solutions.<br class=""><div apple-content-edited="true" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; orphans: 2; widows: 2;" class=""><br class=""></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; orphans: 2; widows: 2;" class=""><font size="3" class=""><br class=""></font></div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class=""><font size="3" style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">refs:</font></div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class=""><font style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""> </font></div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class=""><a href="https://tour.golang.org/concurrency/1" class="">https://tour.golang.org/concurrency/1</a></div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class=""><a href="https://tour.golang.org/concurrency/2" class="">https://tour.golang.org/concurrency/2</a></div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class=""><a href="https://tour.golang.org/concurrency/5" class="">https://tour.golang.org/concurrency/5</a></div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class=""><a href="https://youtu.be/f6kdp27TYZs" class="">https://youtu.be/f6kdp27TYZs</a></div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class=""><br class=""></div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class=""><br class=""></div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class="">What you think?</div><div style="line-height: normal; text-align: -webkit-auto; text-indent: 0px; orphans: 2; widows: 2;" class=""><br class=""></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; orphans: 2; widows: 2;" class="">Daniel</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; orphans: 2; widows: 2;" class=""><font size="3" class=""><br class=""></font></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; orphans: 2; widows: 2;" class="">Daniel Valls Estella · tel. 659.910.830 · <a href="mailto:daniel@upzzle.com" class="">daniel@upzzle.com</a></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">El 22 des 2015, a les 8:33, Andrew Bennett via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> va escriure:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Great proposal! I'm all for this, I think your proposed implementation is pretty good too.</div><div class=""><br class=""></div><div class="">It would be interesting to expand the proposal to consider more cases in more detail:</div><div class=""> * Concurrency</div><div class=""> * SequenceType versus GeneratorType<br class=""></div><div class=""> * Should a language feature depend on the Standard Library (GeneratorType)? Alternatives:<br class=""></div><div class=""> + func myFunction -> () -> T?</div><div class=""> + func myFunction -> () -> (myFunction_State, myFunction_State -> T?)</div><div class=""> * What happens if you write: guard ... else { yield ... }</div><div class=""> * Use an enum for the state that encapsulates all possible variables in each state</div><div class=""><br class=""></div><div class="">If you're not familiar with it, there's another thread that discussed similar here:</div><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001872.html" target="_blank" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001872.html</a><div class=""><br class=""></div><div class="">In particular you may be interested in Chris Lattner's comment:</div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px" class="">I’m very interested in this, but it is clearly out of scope for Swift 3. It should also be considered alongside whatever async/concurrency approach we tackle (likely in swift 4).</blockquote><br class="">Either way it's worth discussing and working towards :)<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Dec 22, 2015 at 6:03 PM, Félix Cloutier <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">There's probably some additional work to do on the proposal document, but I would like to see coroutines in Swift too. The feature has been very successful in other languages like Python and C#, and unless I'm mistaken, work is being done to standardize it in C++.</div><div class=""><br class=""></div><div class="">Generators are one use case, but resumable functions in general can also be used to make async code look prettier.</div><br class=""><div class="">
<span style="border-collapse:separate;line-height:normal;border-spacing:0px" class="">Félix</span>
</div>
<br class=""><div class=""><blockquote type="cite" class=""><span class=""><div class="">Le 22 déc. 2015 à 01:47:05, Susan Cheng via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> a écrit :</div><br class=""></span><div class=""><span class=""><div dir="ltr" class=""><div class="">here is my proposal for swift lang</div><div class=""><br class=""></div><a href="https://github.com/SusanDoggie/swift-evolution/blob/master/proposals/0018-coroutine-for-swift.md" target="_blank" class="">https://github.com/SusanDoggie/swift-evolution/blob/master/proposals/0018-coroutine-for-swift.md</a><br class=""></div>
</span><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=iRI3beHTe3UxYAHTlV3lA38zIPfHMhyuRzgTmGKV6k7cXv8i0D9519DoK7KYHAZzDNERxafB1pe872Yhhmi-2BiyWxsAHedNi3wh4t89fT-2BKwnNGjs9DnBFwV5eBmT6fDCjciSJZI8IeZaYr0UgGPnYQEVopgJV1xozCPgVx1QMsXTqwKj8GReKDgqgfrW75KolAqOxHlNELRYO4sMeFmSxsguQIkEf4l8dL3CnbhvjmU-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class="">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=pQw7h83fWt3LLbgkfL4TSUL0weaZnVFZxDe5GShw4uRNKnTGhJeGxonM5msZE9opXco5hFz-2FepMTWpqOJKwxo-2Fe2VIVN6mVOrF-2BaySWURX-2BPZVsXp943zQJP31RiLgQHnpSgAtVY9mOb2RSUc-2FH4BhtUrKfWxse4Yvsyqr2k8wpDc9XBkOOssTr9lEtGPAkjmAzuM5b-2BPWpODXHOcg7J8BK9kuIMAJmyZbwiu-2BC5qAQ-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important" class="">
</div>
<br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=AdkfTiApI80cNEyortTzHW0kAjxqiRekfpEJArOEyyqmj4DRJx3ooJIHhV9lkZZFHQGuvpvgJ07djNDDr2cbO55ipOSLSgPiqKL6f2al0u374ShmXDyxxYjmu15DYu5LcQMApCVA087QaLw2hnsJZhbDN-2Fy7dLsjtWNZtEUOGpNGAv14a87mB3JmoluyGczE1totvhAJl6rgjxcY-2FGfKZZLIq6GDCiqz267BKWGvDbg-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>