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
140
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
610
Clean Architecture 3
hokuron
0
24
Clean Architecture 2
hokuron
0
46
Create MLで犬と猫の肉球を学習
hokuron
0
80
Other Decks in Programming
See All in Programming
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
役立つログに取り組もう
irof
28
9.6k
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
910
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.7k
みんなでプロポーザルを書いてみた
yuriko1211
0
260
EventSourcingの理想と現実
wenas
6
2.3k
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
110
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
890
CSC509 Lecture 12
javiergs
PRO
0
160
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Featured
See All Featured
Writing Fast Ruby
sferik
627
61k
Practical Orchestrator
shlominoach
186
10k
Speed Design
sergeychernyshev
24
610
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Designing for humans not robots
tammielis
250
25k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
How GitHub (no longer) Works
holman
310
140k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
What's in a price? How to price your products and services
michaelherold
243
12k
Adopting Sorbet at Scale
ufuk
73
9.1k
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
!