[swift-evolution] Proposal: "inout" in for loops

Chris Lattner clattner at apple.com
Sat Dec 12 01:50:39 CST 2015


Hi Amir,

Please read up on the semantics of for-in loops & generators, and if you think this is a good idea, then propose the actual language changes necessary to provide this behavior.  Thanks,

-Chris

> On Dec 11, 2015, at 5:12 AM, Amir Michail via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Examples:
> 
> var x=[1,2,3]
> for inout v in x {
>    v++
> }
> 
> for inout d in d1, d2, d3 { // can’t use list here as it would result in copying of dictionaries
>       d.removeAll()
> }
> 
>  
> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151211/000a5baf/attachment.html>


More information about the swift-evolution mailing list