Fallthrough ceases to make much sense with braces, and it is a handy feature of switch statements every so often. On Thu, Jul 7, 2016 at 15:31 Roth Michaels via swift-evolution < [email protected]> wrote:
> On Thu, Jul 07 2016 at 04:07:06 PM, G B via swift-evolution < > [email protected]> wrote: > > I feel like this would be more consistent with the rest of the syntax: > > > > switch x { > > case 0 { print(0) } > > case 1 { print(1) } > > case 2 { print(2) } > > default { print("other”) } > > } > > > > The colon syntax evokes a label, but the modern, complex `case` > > statements in Swift don’t act much like labels. > > I sort of see what you are saying about `case` not seeming like a label > since we don't have GOTO in Swift. > > I prefer the colon vs your brace suggestion, because from my > perspective, the `switch` expression is the control flow statement and > to the cases are like some sort of label even if they include complex > pattern matching. > > While Scala drops the colon to avoid case statements looks like labels, > but uses => instead of whitespace and {} --- I prefer this to your > suggestion, but as I said also think the colon is fine. > > -- > Roth Michaels > [email protected] > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
