- Swift Functional Programming(Second Edition)
- Dr. Fatih Nayebi
- 75字
- 2021-07-02 23:54:23
Type annotation
In Swift, it is possible to annotate types, or in other words, explicitly specify the type of a variable or expression. Let's look at the following example:
let pi: Double = 3.14159
let piAndPhi: (Double, Double) = (3.14159, 1.618)
func ourFunction(a: Int) { /* ... */ }
In this example, we define a constant (pi) annotated as Double, a tuple named piAndPhi annotated as (Double, Double), and a parameter of ourFunction as Int.
推薦閱讀
- 有趣的二進制:軟件安全與逆向分析
- 計算機信息技術基礎實驗與習題
- MySQL從入門到精通(第3版)
- 數據庫技術及應用教程
- 圖數據實戰:用圖思維和圖技術解決復雜問題
- 企業級容器云架構開發指南
- Hadoop大數據開發案例教程與項目實戰(在線實驗+在線自測)
- Splunk智能運維實戰
- Google Cloud Platform for Developers
- 新手學會計(2013-2014實戰升級版)
- Mastering LOB Development for Silverlight 5:A Case Study in Action
- Gideros Mobile Game Development
- 云計算寶典:技術與實踐
- Working with OpenERP
- Feature Engineering Made Easy