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
52
Generalized accessors
Takuma Shimizu
March 27, 2019
Tweet
Share
More Decks by Takuma Shimizu
See All by Takuma Shimizu
Peek in Calendar implementation of swift-foundation
hokuron
0
81
MVVM
hokuron
0
18
Summon Rust from Swift
hokuron
0
480
Opaque Result Type in Swift with Rust
hokuron
0
110
Ownership of Swift as seen from iteration and Rust
hokuron
1
550
Clean Architecture 3
hokuron
0
22
Clean Architecture 2
hokuron
0
44
Create MLで犬と猫の肉球を学習
hokuron
0
68
Clean Architecture
hokuron
0
84
Other Decks in Programming
See All in Programming
2 週間で Twitter Bot を作ってみた
contour_gara
0
350
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
170
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
PHPの次期バージョンはこの時期どうなっているのか - Internalsの開発体制について - PHPカンファレンス小田原
youkidearitai
PRO
1
190
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
690
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
Ruby GitHub Packages
bkuhlmann
0
630
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.4k
SIMD Parallel Programming with the Vector API
josepaumard
0
160
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
320
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
110
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
164
13k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
6
1.5k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Code Reviewing Like a Champion
maltzj
514
39k
Visualization
eitanlees
136
14k
The Illustrated Children's Guide to Kubernetes
chrisshort
31
46k
Docker and Python
trallard
34
2.7k
Embracing the Ebb and Flow
colly
80
4.1k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Producing Creativity
orderedlist
PRO
337
39k
The Cult of Friendly URLs
andyhume
74
5.7k
Web development in the modern age
philhawksworth
202
10k
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
!