> On Dec 20, 2015, at 10:19 AM, Stephen Celis <[email protected]> wrote:
> 
> There was a thread for this posted yesterday:
> 
> https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151214/003631.html
> 

Much of that discussion doesn’t consider the possibility of making braces 
OPTIONAL as shown in the examples.

> Stephen
> 
>> On Dec 20, 2015, at 10:17 AM, Amir Michail via swift-evolution 
>> <[email protected]> wrote:
>> 
>> // braces are optional here but you could still put them in if you want to
>> for i in 0..<10
>>   for j in 0..<5
>>       if i % 2 == 0
>>           print(i+j)
>>       print(i*j)
>> 
>> // braces are necessary because “print" is on the same line as ”if"
>> for i in 0..<10
>>   for j in 0..<5
>>       if i % 2 == 0 { print(i+j) }
>>       print(i*j)
>> 
>> // braces are necessary with incorrect/unconventional indentation
>>   for i in 0..<10 {
>> for j in 0..<5 {
>> if i % 2 == 0 {
>> print(i+j)
>> }
>> print(i*j)
>> }
>> }
>> 
>> As for the space vs tab issue, my preference would be to allow only spaces 
>> to make braces optional. An alternative would be to use the python 3 
>> indentation rules with respect to spaces and tabs.
>> _______________________________________________
>> 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

Reply via email to