- Swift Functional Programming(Second Edition)
- Dr. Fatih Nayebi
- 58字
- 2021-07-02 23:54:28
Subscripts
Subscripts are shortcuts to access the member elements of a collection, list, sequence, or any custom type that implement subscripts. Consider the following example:
struct TimesTable {
let multiplier: Int
subscript(index: Int) ->Int {
return multiplier * index
}
}
let fiveTimesTable = TimesTable(multiplier: 5)
print("six times five is \(fiveTimesTable[6])")
// prints "six times five is 30"
推薦閱讀
- Redis使用手冊
- Hands-On Data Structures and Algorithms with Rust
- Python絕技:運用Python成為頂級數據工程師
- 從零開始學Hadoop大數據分析(視頻教學版)
- 輕松學大數據挖掘:算法、場景與數據產品
- Voice Application Development for Android
- 商業分析思維與實踐:用數據分析解決商業問題
- Oracle高性能自動化運維
- 圖數據實戰:用圖思維和圖技術解決復雜問題
- Solaris操作系統原理實驗教程
- 區域云計算和大數據產業發展:浙江樣板
- 數據庫查詢優化器的藝術:原理解析與SQL性能優化
- Microsoft Dynamics NAV 2015 Professional Reporting
- Learning Ansible
- Access 2010數據庫應用技術教程(第二版)