On Fri, Jun 24, 2016 at 4:33 PM, Erica Sadun <[email protected]> wrote:
> > On Jun 24, 2016, at 12:04 AM, Xiaodi Wu <[email protected]> wrote: > > On Fri, Jun 24, 2016 at 12:59 AM, William Shipley via swift-evolution < > [email protected]> wrote: > >> Here are some of my real-world examples: >> >> for modelUUIDAndInterfaceElement in modelUUIDsToInterfaceElements >> where !usedInterfaceElements.contains(modelUUIDAndInterfaceElement.1) { >> > > Not a practitioner of 80-character line limits, I take it? > > > 80-character line limits aren't why these examples are problematic for me. > Sorry, I'm going to selfishly interject here to clarify what I meant by that question to Wil. I was not implying that his code was problematic for me--far be it from me to critique Wil's code or style, a task for which I'm not qualified. And I'm truly appreciative that Wil was willing to share his code so that we could learn about the use of `where` in closed-source contexts. The point I was trying to bring up was that a purported advantage of keeping `where` is moot for those who *do* observe line limits, which includes the Swift stdlib itself as well as (IIUC) house style at Google, Microsoft, etc. > Other than a few positive examples like this wall.anchors one, > > for anchor in wall.anchors where boundsRect.contains(anchor. > origin) { > > > most of these read as if there is too much logic stuffed into a single > line: > > for otherWall: Wall in self where otherWall != wall && !removedWalls. >> contains(otherWall) { >> >> >> 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) { >> >> … >> >> > -- E > > >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
