[swift-evolution] Proposal: Add generator functions to the language
andrey at tarantsov.com
Fri Dec 11 20:20:48 CST 2015
> Another possible syntax, inspired by "throws".
> func foo() yield -> String
Well, again, yielding is an implementation detail. What's the advantage vs returning Generator<String>? I don't think that lying about the return type is useful for anyone.
> I'm not sure what happens if a function both yields and throws.
An excellent question. We'd need another generator type with "next() throws".
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution