[Swift-devel] iterate behaviour round II

Ben Clifford benc at hawaga.org.uk
Wed Aug 3 10:20:46 CDT 2011


On Aug 3, 2011, at 4:23 PM, Michael Wilde wrote:

> 
> To start a parallel thread here: how feasible is it (within the write-once variable model and scope-creation semantics that iterate uses) to provide the 3 C iteration statements with syntax and semantics as close to C as possible?

the independent-iterations use cases are pretty well covered by foreach, I think. (where each iteration is independent of other iterations).

the non-indepent-iterations use cases are fairly poorly defined, and its hard to throw syntax suggestions around without those. swift had 'while' in the past, 'iterate' which replaced it but which is fairly ugly, and the suggestion i made earlier in this thread which I like better than iterate but is still ugly.

More suggestions would be interesting, even if just for scoping out what people want from such a construct.

-- 




More information about the Swift-devel mailing list