Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Generalized accessors
Search
Takuma Shimizu
March 27, 2019
Programming
0
58
Generalized accessors
Takuma Shimizu
March 27, 2019
Tweet
Share
More Decks by Takuma Shimizu
See All by Takuma Shimizu
Swift Attributes
hokuron
0
340
Peek in Calendar implementation of swift-foundation
hokuron
0
130
MVVM
hokuron
0
33
Summon Rust from Swift
hokuron
0
600
Opaque Result Type in Swift with Rust
hokuron
0
130
Ownership of Swift as seen from iteration and Rust
hokuron
1
600
Clean Architecture 3
hokuron
0
24
Clean Architecture 2
hokuron
0
46
Create MLで犬と猫の肉球を学習
hokuron
0
79
Other Decks in Programming
See All in Programming
/←このスケジュール表に立ち向かう フロントエンド開発戦略 / A front-end development strategy to tackle a single-slash schedule.
nrslib
1
580
Nuxtベースの「WXT」でChrome拡張を作成する | Vue Fes 2024 ランチセッション
moshi1121
1
290
Golang と Erlang
taiyow
8
1.8k
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
350
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
3
1.1k
CSC509 Lecture 07
javiergs
PRO
0
140
Kotlinの好きなところ
kobaken0029
0
220
Modern Angular: Renovation for Your Applications
manfredsteyer
PRO
0
160
生成 AI を活用した toitta 切片分類機能の裏側 / Inside toitta's AI-Based Factoid Clustering
pokutuna
0
530
いかにして不足・不整合なくデータ移行したか
tjmtmmnk
1
1k
AWS IaCの注目アップデート 2024年10月版
konokenj
3
2.1k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
4
150
Featured
See All Featured
A better future with KSS
kneath
238
17k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
GraphQLの誤解/rethinking-graphql
sonatard
66
9.9k
Become a Pro
speakerdeck
PRO
24
4.9k
Speed Design
sergeychernyshev
24
560
RailsConf 2023
tenderlove
29
870
4 Signs Your Business is Dying
shpigford
180
21k
Practical Orchestrator
shlominoach
186
10k
Code Review Best Practice
trishagee
64
17k
Building Adaptive Systems
keathley
38
2.2k
Transcript
subscrit get set
get let nums = Array(0..<10) let x10 = nums[3] *
10 // `get` print(num) subscript(index: Int) -> Element { get { let element = // `index` return element // } set { ... } }
set var nums = Array(0..<10) let num = nums[3] nums[3]
= num * 10 // `set` print(num) subscript(index: Int) -> Element { get { ... } set(newValue) { // `newValue` // buffer = newValue } }
Swift 4.2 mutableAddressWithPinnedNativeOwner Swift 5 read , modify yield co-routine
read // CoreAudio.swift subscript(index: Index) -> Element { _read {
yield ((_audioBuffersPointer + index).pointee) } } modify // Array.swift subscript(index: Int) -> Element { _modify { let address = _buffer.subscriptBaseAddress + index yield &address.pointee } }
yield subscript(index: Int) -> inout Element {} inout Rust Lifetime
Rust Swift
yield
!