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
63
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
620
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
85
Other Decks in Programming
See All in Programming
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
820
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
530
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
150
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
350
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
730
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
190
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
330
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
103 Early Hints
sugi_0000
1
260
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
230
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Speed Design
sergeychernyshev
25
680
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Automating Front-end Workflow
addyosmani
1366
200k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Embracing the Ebb and Flow
colly
84
4.5k
Testing 201, or: Great Expectations
jmmastey
41
7.1k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Gamification - CAS2011
davidbonilla
80
5.1k
How to Think Like a Performance Engineer
csswizardry
22
1.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
!