- 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.
推薦閱讀
- 同步:秩序如何從混沌中涌現
- 數據分析實戰:基于EXCEL和SPSS系列工具的實踐
- Python金融大數據分析(第2版)
- 分布式數據庫系統:大數據時代新型數據庫技術(第3版)
- 文本挖掘:基于R語言的整潔工具
- Starling Game Development Essentials
- gnuplot Cookbook
- 大數據技術原理與應用:概念、存儲、處理、分析與應用
- MySQL技術內幕:InnoDB存儲引擎
- Access 2016數據庫應用基礎
- 數據中臺實戰:手把手教你搭建數據中臺
- Visual Studio 2012 and .NET 4.5 Expert Development Cookbook
- 算力芯片:高性能CPU/GPU/NPU微架構分析
- Unity 4.x Game AI Programming
- Discovering Business Intelligence Using MicroStrategy 9