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
73
Generalized accessors
Takuma Shimizu
March 27, 2019
Tweet
Share
More Decks by Takuma Shimizu
See All by Takuma Shimizu
Swift Attributes
hokuron
0
380
Peek in Calendar implementation of swift-foundation
hokuron
0
160
MVVM
hokuron
0
44
Summon Rust from Swift
hokuron
0
640
Opaque Result Type in Swift with Rust
hokuron
0
150
Ownership of Swift as seen from iteration and Rust
hokuron
1
640
Clean Architecture 3
hokuron
0
39
Clean Architecture 2
hokuron
0
59
Create MLで犬と猫の肉球を学習
hokuron
0
93
Other Decks in Programming
See All in Programming
推しメソッドsource_locationのしくみを探る - はじめてRubyのコードを読んでみた
nobu09
2
380
Drawing Heighway’s Dragon- Recursive Function Rewrite- From Imperative Style in Pascal 64 To Functional Style in Scala 3
philipschwarz
PRO
0
210
⚪⚪の⚪⚪をSwiftUIで再現す る
u503
0
150
気がついたら子供が社会人になって 自分と同じモバイルアプリエンジニアになった件 / Parent-Child Engineers
koishi
0
210
DevNexus - Create AI Infused Java Apps with LangChain4j
kdubois
0
160
ステートソーシング型イベント駆動の視点で捉えるCQRS+ES
shinnosuke0522
0
130
iOSでQRコード生成奮闘記
ktcryomm
2
160
もっと大きなデータを送りませんか? エラーがゴロゴロ出るようなデータです
sublimer
0
130
CIBMTR振り返り+敗北から学ぶコンペの取り組み方反省
takanao
1
380
requirements with math
moony
0
370
CQRS+ES勉強会#1
rechellatek
0
170
「その気にさせる」エンジニアが 最強のリーダーになる理由
gimupop
3
340
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Being A Developer After 40
akosma
89
590k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
11
570
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
What's in a price? How to price your products and services
michaelherold
244
12k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
176
52k
Building Adaptive Systems
keathley
40
2.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
50
2.3k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
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
!