- Swift Functional Programming(Second Edition)
- Dr. Fatih Nayebi
- 103字
- 2021-07-02 23:54:20
Type safety and type inference
Swift has a strong emphasis on types. Classes, enums, structs, protocols, functions, and closures can become types and be used in program composition.
Swift is a type-safe language, unlike languages such as Ruby and JavaScript. As opposed to type-variant collections in Objective-C, Swift provides type-safe collections. Swift automatically deducts types by the type-inference mechanism, a mechanism that is present in languages such as C# and C++ 11. For instance, constString in the following example is inferred as String during compile time, and it is not necessary to annotate the type:
let constString = "This is a string constant"
推薦閱讀
- 數據產品經理高效學習手冊:產品設計、技術常識與機器學習
- 計算機綜合設計實驗指導
- 數據挖掘原理與實踐
- 大數據可視化
- PySpark大數據分析與應用
- 大數據算法
- Mastering Machine Learning with R(Second Edition)
- 達夢數據庫性能優化
- INSTANT Cytoscape Complex Network Analysis How-to
- 數據挖掘原理與SPSS Clementine應用寶典
- 云原生數據中臺:架構、方法論與實踐
- Hadoop集群與安全
- 大數據技術原理與應用:概念、存儲、處理、分析與應用
- Expert Python Programming(Third Edition)
- Visual FoxPro數據庫技術基礎