書名: Swift Functional Programming(Second Edition)作者名: Dr. Fatih Nayebi本章字數: 66字更新時間: 2021-07-02 23:54:24
Tuples
Swift provides tuples so that they can be used to group multiple values/types into a single compound value. Consider the following example:
let http400Error = (400, "Bad Request")
// http400Error is of type (Int, String), and equals (400, "Bad Request")
// Decompose a Tuple's content
let (requestStatusCode, requestStatusMessage) = http400Error
Tuples can be used as return types in functions to implement multi-return functions as well.
推薦閱讀
- 從零開始學Hadoop大數據分析(視頻教學版)
- Test-Driven Development with Mockito
- Python廣告數據挖掘與分析實戰
- 算法與數據中臺:基于Google、Facebook與微博實踐
- 大數據:從概念到運營
- 大數據架構和算法實現之路:電商系統的技術實戰
- MySQL 8.x從入門到精通(視頻教學版)
- SQL優化最佳實踐:構建高效率Oracle數據庫的方法與技巧
- 數據科學實戰指南
- Solaris操作系統原理實驗教程
- Mastering LOB Development for Silverlight 5:A Case Study in Action
- 數據應用工程:方法論與實踐
- Unity for Architectural Visualization
- MySQL核心技術手冊
- Learn Selenium