swift 有些语法还是不支持。

<pre name="code" class="html">“func hasAnyMatches(list: Int[], condition: Int -> Bool) -> Bool {
    for item in list {
        if condition(item) {
            return true
        }
    }
    return false
}
func lessThanTen(number: Int) -> Bool {
    return number < 10
}
var numbers = [20, 19, 7, 12]
hasAnyMatches(numbers, lessThanTen)”

摘录来自: Apple Inc. “The Swift Programming Language”。 iBooks. https://itunes.apple.com/cn/book/swift-programming-language/id881256329?mt=11


“func makeIncrementer() -> (Int -> Int) { 
 func addOne(number: Int) -> Int { 
       retur n 1 + number 
   } 
return addOne
}

var increment = makeIncrementer()
increment(7)


”摘录来自: Apple Inc. “The Swift Programming Language”。 iBooks. https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewBook?id=881256329

不支持:

a,b = (1,2)

blist=alist[1:3]


原文地址:https://www.cnblogs.com/lcchuguo/p/4517797.html