> On Jul 11, 2016, at 7:27 AM, Rob Mayoff <[email protected]> wrote:
> 
> Just to be clear, under your proposal, what does the following program
> print? Can you make an argument in favor of your interpretation?
> 
>    var x = 1
>    switch x {
>    case 1:
>        print("one")
>        x = 2
>        continue
>    case 2:
>        print("two")
>    default:
>        break
>    }

The switch statement is defined as:

switch-statement → switch expression {switch-cases*}

I'd imagine this means the expression is evaluated once, e.g.:

switch 2 + 3 {
case 5: print("Five!")
default: break
}

So I'm more likely to expect "one" than "one"/"two".  I would defer this 
question 
to the core team for a better answer.

-- E

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to