> On Oct 13, 2016, at 9:31 AM, Chris Lattner via swift-evolution
> wrote:
>
>>
>> On Oct 13, 2016, at 4:26 AM, Alex Blewitt via swift-evolution
>> mailto:swift-evolution@swift.org>> wrote:
>>
>> On 13 Oct 2016, at 11:06, Haravikk via swift-evolution
>> mailto:swift-evolution@swift.org>> wro
> On 13 Oct 2016, at 16:19, Nevin Brackett-Rozinsky via swift-evolution
> wrote:
>
> If I might be so bold, perhaps we should consider the opposite. Suppose you
> have a conditional statement inside a loop. It would be easier for the reader
> to understand what it does if “break” meant the sa
> On Oct 13, 2016, at 4:26 AM, Alex Blewitt via swift-evolution
> wrote:
>
> On 13 Oct 2016, at 11:06, Haravikk via swift-evolution
> mailto:swift-evolution@swift.org>> wrote:
>>
>>>
>>> On 11 Oct 2016, at 19:43, Erica Sadun via swift-evolution
>>> mailto:swift-evolution@swift.org>> wrote:
If I might be so bold, perhaps we should consider the opposite. Suppose you
have a conditional statement inside a loop. It would be easier for the
reader to understand what it does if “break” meant the same thing
regardless of whether you used “if” or “switch” for the condition.
Right now, these t
> On 13 Oct 2016, at 12:26, Alex Blewitt wrote:
>
> On 13 Oct 2016, at 11:06, Haravikk via swift-evolution
> mailto:swift-evolution@swift.org>> wrote:
>>
>>>
>>> On 11 Oct 2016, at 19:43, Erica Sadun via swift-evolution
>>> mailto:swift-evolution@swift.org>> wrote:
>>>
>>> I thought this wa
On 13 Oct 2016, at 11:06, Haravikk via swift-evolution
wrote:
>
>>
>> On 11 Oct 2016, at 19:43, Erica Sadun via swift-evolution
>> mailto:swift-evolution@swift.org>> wrote:
>>
>> I thought this was long gone but today I found out it is still legal:
>>
>> switch i {
>> case 4 ... 6: ()
>> cas
> On 11 Oct 2016, at 19:43, Erica Sadun via swift-evolution
> wrote:
>
> I thought this was long gone but today I found out it is still legal:
>
> switch i {
> case 4 ... 6: ()
> case 3: print("Here")
> default: break
> }
>
> Is there a motivating factor for keeping this in the language? The
Fair enough. I defer to both of you.
Thanks, -- E
> On Oct 11, 2016, at 1:41 PM, Robert Widmann wrote:
>
> I agree, though it may seem counterintuitive at first. () is a value of unit
> type that exists here to satisfy the sema’s requirements that all branches
> are destructive, productive o
I agree, though it may seem counterintuitive at first. () is a value of unit
type that exists here to satisfy the sema’s requirements that all branches are
destructive, productive or defer to another productive branch.
~Robert Widmann
> On Oct 11, 2016, at 2:54 PM, Xiaodi Wu via swift-evolutio
Well, unless I'm mistaken, `()` here is a value. I can replace it with `3`
and the compiler emits a warning about unused results. I'm guessing that
since () is a value of type Void, the warning about unused results isn't
triggered.
While it's true that `Void` causes an error, I can write `Void()` i
I thought this was long gone but today I found out it is still legal:
switch i {
case 4 ... 6: ()
case 3: print("Here")
default: break
}
Is there a motivating factor for keeping this in the language? The compiler
picks up on Void and emits an error. You'd think () would produce the same
results
11 matches
Mail list logo