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
62
Generalized accessors
Takuma Shimizu
March 27, 2019
Tweet
Share
More Decks by Takuma Shimizu
See All by Takuma Shimizu
Swift Attributes
hokuron
0
360
Peek in Calendar implementation of swift-foundation
hokuron
0
140
MVVM
hokuron
0
37
Summon Rust from Swift
hokuron
0
610
Opaque Result Type in Swift with Rust
hokuron
0
130
Ownership of Swift as seen from iteration and Rust
hokuron
1
620
Clean Architecture 3
hokuron
0
31
Clean Architecture 2
hokuron
0
50
Create MLで犬と猫の肉球を学習
hokuron
0
84
Other Decks in Programming
See All in Programming
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
useSyncExternalStoreを使いまくる
ssssota
6
1k
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
Jakarta EE meets AI
ivargrimstad
0
230
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
1k
testcontainers のススメ
sgash708
1
120
命名をリントする
chiroruxx
1
380
선언형 UI에서의 상태관리
l2hyunwoo
0
140
Haze - Real time background blurring
chrisbanes
1
500
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Practical Orchestrator
shlominoach
186
10k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Building an army of robots
kneath
302
44k
Mobile First: as difficult as doing things right
swwweet
222
9k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Docker and Python
trallard
41
3.1k
Music & Morning Musume
bryan
46
6.2k
Agile that works and the tools we love
rasmusluckow
328
21k
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
!