// 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

Reply via email to