[swift-evolution] SE-0105: Removing Where Clauses from For-In Loops

Erica Sadun erica at ericasadun.com
Fri Jun 24 08:24:15 CDT 2016


Thank you for collecting and sharing these. 

I suspect both of us look at these and say "Ah yes, this supports exactly what I've been saying".

-- E

> On Jun 23, 2016, at 11:59 PM, William Shipley <wjs at mac.com> wrote:
> 
> Here are some of my real-world examples:
> 
>         for modelUUIDAndInterfaceElement in modelUUIDsToInterfaceElements where !usedInterfaceElements.contains(modelUUIDAndInterfaceElement.1) {
>>         }
> 
>         for anchor in wall.anchors where boundsRect.contains(anchor.origin) {
>>         }
> 
>         for otherWall: Wall in self where otherWall != wall && !removedWalls.contains(otherWall) {
>>         }
> 
>         for wall in self as Set<Wall> {
>             for otherWall in self as Set<Wall> where otherWall != wall {
>>             }
>         }
> 
>         for wall in self as Set<Wall> where !checkedWalls.contains(wall) {
>>         } 
> 
> (x2 on that one)
> 
>         for otherPieceOfFurnitureNode in localFurnitureModelUUIDsToInterfaceElements!.values where otherPieceOfFurnitureNode !== pieceOfFurnitureNode {
>>         }
> 
>         for lineSegmentObject in wallRelatedLineSegments where remainingLineSegments.contains(lineSegmentObject) {
>>         }
> 
>         for colinearLineSegmentObject in remainingLineSegments where colinearLineSegmentObject.angle.isEssentially(infiniteLineAngle: lineSegmentObject.angle) {
>>         }
> 
> 
> I think this is basically as many as are found on all of github?
> 
> -W

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


More information about the swift-evolution mailing list